Data Structure Questions In Technical Interviews
Its open for Engineers for all Branches.
TRY TO ANSWER THESE HERE:
1. What do you mean by 'data structures'?
2. What are the major applications of data structures?
3. Which is the best sorting technique and why?
4. Does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes?
If you have more questions share them here. Posted in: #Coffee Room
1. Data Structures are used to organize and store the data,inorder to use the data effectively.
2.There are many Applications.Here are some,
☆ Stacks in Memory management of OS,Expression Evaluation,Program Execution,in games.
☆ Queues in a waiting list of applications.
☆ Linked lists for storing web browser history.
☆ Trees in Linux file system, as Syntax tree in compilers,as document object models.
3. Quick Sort is the best Sorting technique because its average time complexity is O (n logn).Due to its logic of sorting,as selecting the pivot element and approaching to sort in both the sides (by splitting the upper and lower ranges using pivot element ),it has the lower time complexity.
4.As Minimum Spanning tree is a Spanning tree which is connected,weighted and undirected graph and that has minimum possible total weight. Yes,we can find the shortest distance or minimum weight edges between the given to specified nodes.
Kruskal algorithm and Prims algorithm are used to find the minimum Spanning trees.
1) Data structure is a specific way of organizing data in a computer so that it favours operations like insertion,deletion,searching etc
Web-browsers uses linked lists of webpages to facilitate backward and forward movement of webpages
Stack data structure is used to support recursion
Queues are used in cpu scheduling by operating system
Best application for tree datastructure is filesystem.
look at the above picture Shortest distance between vertex d and c is 3 But in minimum spanning tree shortest distance between d and c is 5. Therefore,we can conclude that mst doesn't always give shortest distance between 2 Nodes
1. Data structures are the one which will store the data in a effective and efficient manner.
2. Linked lists store web browser data
Queues are used in cpu scheduling
Stacks are used for evaluating postfix expression, converting infix to postfix expression
3. Quick sort and it's time complexity is O(n log n)
How is a binary search tree implemented?
How do you perform preorder traversal in a given binary tree?
How do you traverse a given binary tree in preorder without recursion?
How do you perform an inorder traversal in a given binary tree?
How do you print all nodes of a given binary tree using inorder traversal without recursion?
How do you implement a postorder traversal algorithm?
How do you traverse a binary tree in postorder traversal without recursion?
How are all leaves of a binary search tree printed?
How do you count a number of leaf nodes in a given binary tree?
How do you perform a binary search in a given array?