Home






1. What are Data Structures?

Data structures are the methods and techniques used to maintain data in an organized fashion. This is primarily done to ensure that data can be manipulated and accessed in an efficient manner. Data dependency and relationships between two or more entities of data also play a vital role in the concept of data structures.

2. what is linear and non linear data structure?

In a linear data structure, the data elements connect to each other sequentially. A user can transverse each element through a single run. Data elements are stored next to each other . E.g.: Arrays, linked lists, stacks, and queues

In a non-linear data structure, the data elements connect to each other hierarchically. Thus, they are present at various levels. Data elements can be separated by other entities in memory. E.g.: Trees and graphs.

3. What is the difference between a File Structure and a Data Structure?

While data structures deal with data in main memory, file structures deal with data in secondary storage devices such as hard disks. Both involve representation of data and the operation of accessing data.

4. What is a linked list?


A linked list is a data structure that consists of individual entities called nodes. These nodes have the capability to connect to other nodes and create a chain in the process. This continuous chain structure forms a linked list, as the name suggests.

5. What are the types of searching used in Data Structures?

The two primary methods of searching are linear search and binary search.

* Linear search involves iterating over a data unit in order to perform the required operation.

* Binary search is more efficient in a way that it has the ability to split the data unit into chunks and then perform a search operation.

6. How does binary search work?


Binary search is used when there is primarily a criterion of efficiency. It involves working on the already ordered data, which is sorted either in ascending or in descending order. To begin with, the middle element of the array is found out, and the search begins from there. The array is searched in two parts based on the search value being higher or lower than the middle element. It is key to know the order of the arrangement to help search the value accordingly.

7. How are individual elements accessed in an array?


Each of the values in an array is given an index position starting from 0 to n-1, where ‘n’ is the number of elements in the array. Individual elements can be accessed by using the index element for operations. Multi-dimensional arrays will have more than one dimension to work with.

8. What is a queue in Data Structures?


A queue is a widely used data structure that is used to denote the ordered access and manipulation of an element. The operation of this data structure is exactly the same as a literal queue in the real world. Elements are added one after the other and are processed on the front end.

9. What is a binary tree?



A binary tree, as the name suggests, is a tree data structure with two nodes, which are the nodes on the left and the right sides of the root note. In usage, binary trees are considered to be an extended linked list.

10. What is the meaning of stack?


A stack is another widely used data structure that provides users with the ability to work with data at one point only. As the name suggests, this can literally correspond to the working of a stack of cards.

11. What is the working of LIFO?


LIFO stands for the Last in, First out access order. It is directly corresponding to how the data can be worked on and modified. The data entity that is stored or pushed in last is the first one to be worked on at any point in time. If there is a requirement to access the very first element stored, then first you have to retrieve all of the data that came in after that element.

12. What are multi-dimensional arrays?


Multi-dimensional arrays are arrays that span across more than one dimension. This means that they will have more than one index variable for every point of storage. This is primarily used in cases where data cannot be represented or stored using only one dimension.

13. What is a Binary Search Tree?


A binary search tree is a data structure that stores data in a very efficient manner. It consists of two primary nodes from the root node. The main thing here is that the values of the nodes in the left sub-tree are less in number than the value of the root node, and the values of the nodes on the right of the root node are correspondingly higher than the root. Also, individually both of these left and right sub-trees are their own binary search trees at all points of time.

14. What is the difference between void and null in Data Structures?

Void is a data type identifier in data structures, while null is considered to be a value with no physical presence. When void is used, it indicates that there is no size while initializing the data structure.

15. What is dynamic memory management?

Dynamic memory management is a technique in which storage units are allocated based on the requirements continuously. Using dynamic memory allocations, individual data structures can be either stored separately or combined to form entities called composites. These composites can be worked on when required.

16. What are push and pop operations in Data Structures?


Both push and pop operations denote how data can be stored and used when required in a stack. The push operation denotes that users are adding data into the structure, and the pop operation denotes that the data is being pulled or removed from the structure. Usually, the top-most element is considered when performing push and pop operations.

17. What is merge sort?


Merge sort is a method of sorting, which is based on the divide and conquer technique. Here, data entities adjacent to each other are first merged and sorted in every iteration to create sorted lists. These smaller sorted lists are combined at the end to form the completely sorted list.

18. What is the meaning of Data Abstraction?

Data abstraction is one of the widely used tools in data structures. The goal is to break down complex entities into smaller problems and solve these by using the concepts of data structures. This provides users with the advantage of being focused on the operations and not worried about how the data is stored or represented in the memory.

19. How is a variable stored in memory when using Data Structures?
A variable is stored based on the amount of memory that is needed. First, the required quantity of memory is assigned, and later, it is stored based on the data structure being used. Using concepts such as dynamic allocation ensures high efficiency and that the storage units can be supplied based on the requirements in real time.

20. What is the working of a selection sort?


A selection sort is a widely used sorting algorithm in the world of Data Structures. The working is simple where the smallest entity is first found out and the index of that is set to zero, thereby permanently sorting this in the first step. The remaining steps involve iterating through other elements and adding the next index correspondingly. This is done until all of the elements are sorted.

21. What are the minimum nodes binary trees can have?

Binary trees can have zero nodes or a minimum of 1 or 2 as well. It can be zero in a case where all of the nodes have a NULL value.

22. What Data Structures make use of pointers?

Pointers are used in a variety of data structures. Following data structures uses pointers majorly :

* Binary trees
* Linked lists
* Queues
* Stacks

23. What is the use of dynamic Data Structures?

Dynamic data structures provide users with a lot of flexibility in terms of the provision of data storage and manipulation techniques, which can change during the operation of the algorithm or the execution of the program.

24. What is a priority queue?


A priority queue is an abstract data type that resembles a normal queue but has a priority assigned to elements. Elements with higher priority are processed before the elements with a lower priority. A minimum of two queues are required in this case, one for the data and the other to store the priority.

25. What is the meaning of deque?


A deque is a queue that is double-ended. This means that elements can be added or removed from any one of the two ends. It can be used both as a regular queue and as a stack. It performs better than both linked lists and stacks in general.

26. What is the meaning of an AVL tree?


An AVL tree is a type of a binary search tree where the tree is only slightly balanced. Balance is the unit of comparison between the heights of the subtrees from the main (root) node.

27. How does Huffman’s algorithm work?


Huffman’s algorithm uses a table, containing the frequency of the occurrence of every data entity on the list. This is used for creating extended binary trees, which are known to have minimum weights for the path lengths . This is considering each of the corresponding weights.

28. What are recursive algorithms?

Recursive algorithms are algorithms that solve a problem by breaking it down into simpler sub-problems and then solving them iteratively. The output of one recursion operation is usually the direct input for the next iteration operation, and this process goes on.

29. How does bubble sort work?


Bubble sort is one of the most used sorting techniques out there. It is applied to arrays where elements adjacent to each other are compared and values are exchanged based on the order of arrangement. It’s called bubble sort because of the concept of exchanging elements like a bubble floating to the top of the water and larger entities sinking down to the bottom end.

30. What are the time complexities of linear search and binary search?

Binary search is more effective as it takes lesser comparisons to search for an element in an array. The time complexity for linear search is O(n), while it is O(log n) for binary search.

31. What is the method used for inorder traversal in trees?

In Inorder traversal first the tree is traversed through the left subtree then, the root node is visited after the left visit Then, the right subtree is traversed.

32. What is the working of post-order traversal in trees?

In Postorder traversal First, the left subtree is traversed through then, the right subtree is traversed next. The root node is visited after the right subtree visit.

33. What is the meaning of the stack overflow condition?

Stack overflow is the term given when the stack is full and an element cannot be inserted into the stack anymore. Stack overflow happens when top = Maxsize – 1



Qletus