Data structure Interview Questions and Answers
Question - 61 : - Mention the data structures which are used in graph implementation.
Answer - 61 : -
For the graph implementation, following data structures are used.
- In sequential representation, Adjacency matrix is used.
- In Linked representation, Adjacency list is used.
Question - 62 : - Which data structures are used in BFS and DFS algorithm?
Answer - 62 : -
- In BFS algorithm, Queue data structure is used.
- In DFS algorithm, Stack data structure is used.
Question - 63 : - What are the applications of Graph data structure?
Answer - 63 : -
The graph has the following applications:
- Graphs are used in circuit networks where points of connection are drawn as vertices and component wires become the edges of the graph.
- Graphs are used in transport networks where stations are drawn as vertices and routes become the edges of the graph.
- Graphs are used in maps that draw cities/states/regions as vertices and adjacency relations as edges.
- Graphs are used in program flow analysis where procedures or modules are treated as vertices and calls to these procedures are drawn as edges of the graph.
Question - 64 : - What are the advantages of Binary search over linear search?
Answer - 64 : -
There are relatively less number of comparisons in binary search than that in linear search. In average case, linear search takes O(n) time to search a list of n elements while Binary search takes O(log n) time to search a list of n elements.
Question - 65 : - What are the advantages of Selecetion Sort?
Answer - 65 : -
- It is simple and easy to implement.
- It can be used for small data sets.
- It is 60 per cent more efficient than bubble sort.
Question - 66 : - List Some Applications of Multilinked Structures?
Answer - 66 : -
- Sparse matrix,
- Index generation.
Question - 67 : - What is the difference between NULL and VOID?
Answer - 67 : -
- Null is actually a value, whereas Void is a data type identifier.
- A null variable simply indicates an empty value, whereas void is used to identify pointers as having no initial size.
Question - 68 : - Explain how new data can be inserted into the tree?
Answer - 68 : -
The following are the steps that you need to follow to insert the data into the tree:
- First of all, check whether the data is unique or not ( i.e. check whether the data that you are going to insert doesn’t already exist in the tree).
- Then check if the tree is empty. If the tree is empty then all you need to do is just insert a new item into the root. If the key is smaller than that of a root’s key then insert that data into the root’s left subtree or otherwise, insert the data into the right side of the root’s subtree.
Question - 69 : - Can you tell me the minimum number of nodes that a binary tree can have?
Answer - 69 : -
A binary tree is allowed or can have a minimum of zero nodes. Further, a binary tree can also have 1 or 2 nodes.
Question - 70 : - Explain a little bit about the dynamic data structure?
Answer - 70 : -
The nature of the dynamic data structure is different compared to the standard data structures, the word dynamic data structures means that the data structure is flexible in nature. As per the need, the data structure can be expanded and contracted. Thus it helps the users to manipulate the data without worrying too much about the data structure flexibility.