0% found this document useful (0 votes)
12 views1 page

Data Stucture

The document provides definitions and explanations of various data structures and algorithms in computer science, including data, data structures, strings, arrays, binary trees, and search algorithms. It distinguishes between linear and non-linear data structures, discusses the complexity of linear search, and explains the space-time tradeoff in algorithms. Additionally, it covers word processing operations and compares linear and binary search methods.

Uploaded by

arifinanik2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Data Stucture

The document provides definitions and explanations of various data structures and algorithms in computer science, including data, data structures, strings, arrays, binary trees, and search algorithms. It distinguishes between linear and non-linear data structures, discusses the complexity of linear search, and explains the space-time tradeoff in algorithms. Additionally, it covers word processing operations and compares linear and binary search methods.

Uploaded by

arifinanik2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1. define data ???? 8. Define string short ans ?????? 15. Binary Tree Data Structure ?????????

In computer science a data structure is a data organization A string is a sequence of characters used to represent text A Binary Tree Data Structure is a hierarchical data
management and storage format that enable efficient in programming. Strings can include letters, numbers, structure in which each node has at most two children,
access and modification...... symbols, and whitespace, and are typically enclosed in referred to as the left child and the right child. It is
quotation marks (e.g., "Hello, World!"). They are commonly used in computer science for efficient storage
2. define data structure ???? commonly used for storing and manipulating textual data. and retrieval of data, with various operations such as
data are simply va;ies or set values.a data item refers to a insertion, deletion, and traversal.
9. define array ??????
single unit of values . data may be organized in many 16. Extended Binary Tree ????????????
different ways the logical or mathematical model of a An array is a data structure that stores a fixed-size
particular organization of data is called a data structure..... sequence of elements of the same type in contiguous Extended binary tree is a type of binary tree in which all
memory locations. Each element can be accessed using an the null sub tree of the original tree are replaced with
3. describe the different types of data structure index, allowing for efficient retrieval and manipulation of special nodes called external nodes whereas other nodes
??????? data. For example, an array of integers can be defined as are called internal nodes....Properties of External binary
Data structures are ways of organizing and storing data int numbers[] = {1, 2, 3, 4, 5};. tree 1.The nodes from the original tree are internal nodes
efficiently. They can be broadly categorized into two and the special nodes are external nodes. 2. All external
10. Difference Between Array and Record:??????? nodes are leaf nodes and the internal nodes are non-leaf
types: linear and non-linear data structures. Here’s an
overview of both: Linear Data Structures...static > array Array: A collection of elements of the same data type, nodes. 3.Every internal node has exactly two children and
or dynamic > queue > stack > Linked list..... Non-Linear stored in contiguous memory locations. All elements must every external node is a leaf. It displays the result which
Data Structures......Tree or Graph.... Each data structure be of the same type (e.g., all integers). Accessed using an is a complete binary tree.
has its own strengths and is chosen based on the specific index. Used for lists of similar items, like a list of scores. 17.. . Complete Binary Tree ?????????
requirements of the operation or application.
Record: A composite data structure that can hold different A complete binary tree is a type of binary tree where all
4. distinguish between linear and non linear data data types, typically organized into fields. Can contain levels are fully filled except possibly the last level, which
structure ????????? multiple types (e.g., an integer, a string, and a float in one is filled from left to right. This structure ensures that the
record). Accessed using field names. Used for more tree is as compact as possible, minimizing the height and
Here’s a distinction between linear and non-linear data complex data structures, like a student record containing
structures: Linear Data Structures: Elements arranged making operations like insertion and deletion more
name, age , grades .In summary, arrays are homogeneous efficient Properties of a Complete Binary Tree ...1..All
sequentially.Traversed in a single pass. Uses contiguous collections of data, while records are heterogeneous
memory. Examples: Arrays, Linked Lists, Stacks, Queues. levels except the last are fully filled: This ensures that the
structures combining different types of data. tree is balanced and operations are efficient.
Non-Linear Data Structures: 11. write an algorithm for binary search ??? 2.. Nodes at the last level are filled from left to right: This
Elements arranged hierarchically or Binary Search algorithm is an interval searching method property ensures that the tree remains compact. 3..
interconnected.Requires multiple paths for traversal.Uses that performs the searching in intervals only. The input Height of the tree: For a complete binary tree with n
non-contiguous memory . Examples: Trees, Graphs, taken by the binary search algorithm must always be in a
Heaps. //Linear structures handle simple, sequential nodes, the height is log(n+1). 4..Number of nodes at depth
sorted array since it divides the array into subarrays based d: At any depth d, the number of nodes is 2^d Complete
relationships, while non-linear structures handle complex, on the greater or lower values. The algorithm follows the
multi-level connections. Binary Tree: All levels are fully filled except possibly the
procedure below −Step 1 − Select the middle item in the
array and compare it with the key value to be searched. If last, which is filled from left to right.
5.Explain the complexity of linear search algorithm
?????????? it is matched, return the position of the median.Step 2 − If
it does not match the key value, check if the key value is
The linear search algorithm is a straightforward method either greater than or less than the median value. Step 3 −
for finding a target element in a list by checking each If the key is greater, perform the search in the right sub-
element one by one until the target is found or the end of array; but if the key is lower than the median value,
the list is reached.Complexity of Linear Search: Time perform the search in the left sub-array.Step 4 − Repeat
Complexity:Best Case: O(1) – The target element is found Steps 1, 2 and 3 iteratively, until the size of sub-array
at the first position.Worst Case: O(n) – The target element becomes 1.Step 5 − If the key value does not exist in the
is either at the last position or not in the list at all, array, then the algorithm returns an unsuccessful search.
requiring checking all n elements.Average Case: O(n) –
On average, the algorithm checks half of the list before 12. write an algorithm for Linear search ???
finding the target or determining it’s absent.Space The algorithm for linear search is relatively simple. The
Complexity:O(1) – Linear search requires a constant procedure starts at the very first index of the input array to
amount of extra space, as it only uses a few variables 1. define data ????
be searched.
regardless of the input size.
2. define data structure ????
Step 1 − Start from the 0th index of the input array,
6. Explain the space time tradeoff algorithm compare the key value with the value present in the 0th 3. describe the different types of data structure ??
?????????? index.Step 2 − If the value matches with the key, return
the position at which the value was found.Step 3 − If the 4. distinguish between linear and non linear data
The space-time tradeoff in algorithms refers to the
value does not match with the key, compare the next structure ??????
balance between time complexity (execution speed) and
space complexity (memory usage). element in the array.Step 4 − Repeat Step 3 until there is a 5.Explain the complexity of linear search algorithm
match found. Return the position at which the match was ??????????
Key Points : 1.Time-Efficient, Space-Intensive: found.Step 5 − If it is an unsuccessful search, print that
Algorithms that run faster by using more memory. For the element is not present in the array and exit the 6. Explain the space time tradeoff algorithm
example, hash tables allow O(1) search time by storing program. ??????????
pre-computed values. 2.Space-Efficient, Time-Intensive:
Algorithms that use less memory but take longer to 13. Bubble Sort Algorithm ????? 7. Discuss various word processing operation with
execute. For example, recursive algorithms may require example ??????
To sort an array by repeatedly stepping through the list,
more time due to repeated calculations. comparing adjacent elements and swapping them if they 8. Define string short ans ??????
Examples:1. Sorting: Merge Sort is O(n log n) in time but are in the wrong order.
9. define array ??????
uses O(n) space, while Quick Sort can be faster but uses Steps: 1.Initialization: Start with an unsorted array.
less space.2.Lookup Tables: Precomputed tables save 10. Difference Between Array and Record:???????
2.Outer Loop: Repeat for each element in the array (n-1
time at the expense of increased memory usage. times): 3.Inner Loop: For each pair of adjacent elements: 11. write an algorithm for binary search ???
In summary, optimizing for speed often involves using Compare the current element with the next element: If 12. write an algorithm for Linear search ???
more memory, while saving memory can lead to slower the current element is greater than the next element, swap
execution times. them and setswapped to true. 4. Early Termination: If no 13. Bubble Sort Algorithm ?????
7. Discuss various word processing operation with swaps were made during an entire pass (i.e., swapped 14. Difference Between Linear Search and Binary
example ?????? remains false), the array is sorted, and you can terminate Search: ????????? box ghor
early. 5.Return: The sorted array.
Word processing operations refer to the various functions 15. Binary Tree Data Structure ?????????
and tasks performed when creating, editing, and 14. Difference Between Linear Search and Binary
formatting text documents. Here are some key operations Search: ????????? box ghor 16. Extended Binary Tree ????????????
with examples: text entry,,,, editing,,,formatting,,,,spell Linear Search : Checks each element sequentially. Works 17.. . Complete Binary Tree ?????????
check and grammar check,,,,,inserting elements,,,,,page on unsorted or sorted arrays. O(n) in all cases. O(1)
layout,,,,,,,,,saving and printing,,,,,,,,,,collaboration,,,,, (iterative version). Simple and easy to implement for
These operations facilitate effective document creation small datasets. ,,,,, Binary Search :: Divides the search
and management in various professional and personal interval in half. Requires a sorted array. O(log n) in
settings. average and worst cases. O(1) (iterative), O(log n)
(recursive). More efficient for large datasets. In summary,
linear search is simpler but slower, while binary search is
faster but requires sorted data.

You might also like