Data Structures interview questions and answers

[quote]What are the different types of traversals?[/quote]
The different types of traversing are

[quote]How pre-order traversal works?[/quote]

[quote]How post-order traversal works?[/quote]

[quote]How in -order traversal works?[/quote]

[quote]How does a function call work?[/quote]

[quote]What is precision?[/quote]

Precision refers to the accuracy of the decimal portion of a value. Precision is the number of digits allowed after the decimal point.

[quote]What does mean by sorting?[/quote]

Ordering the data in an increasing or decreasing fashion according to some relationship among the data item is called sorting.

[quote]What is the difference between storage structure and file structure?[/quote]

The expression of a specific data structure inside the memory of a computer system is termed storage structure in contrast to a storage structure expression in auxiliary memory is normally known as a file structure.

[quote]What is a divide and conquer method?[/quote]

The basic idea is to divide the problem into several subproblems beyond which cannot be further subdivided. Then solve the subproblems efficiently and join them together to get the solution for the main problem.

[quote]What is mean by d-queue?[/quote]
De-queue stands for a double-ended queue. It is an abstract data structure that implements a queue for which elements can be added to front or rear and the elements can be removed from the rear or front. It is also called head-tail linked list

Data Structures interview questions and answers for freshers

[quote]What is an AVL Tree?[/quote]

AVL trees are height balancing binary search tree. AVL tree checks the height of left and right subtrees and assures that the difference is not more than 1 and this difference is called the Balance Factor.

[quote]What is a spanning Tree?[/quote]

A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree once. A minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is minimized.

[quote]Two linked lists L1 and L2 intersect at a particular node N1 and from there all other nodes till the end are common. The length of the lists is not the same. What are the possibilities to find N1?[/quote]

The linear solution is possible. Have two pointers say P1 pointing to the first node of L1 and P2 to that of L2. Traverse through both the lists. If P1 reaches L1’s last node, point it to the first node of L2 and continue traversing. Do the same thing for P2 when it reaches L2’s last node. (By this process we are balancing the difference in the length between the linked lists. The shorter one will get over soon and by redirecting to longer list’s head, it will traverse the extra nodes also.) Finally, they will Meet at the Intersection node.

[quote]What is the difference between NULL and void?[/quote]

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.

[quote]What does mean by recursive function?[/quote]

A recursive function is one which calls itself, directly or calls a function that in turn calls it. Every recursive function follows the recursive properties – base criteria where functions stop calling itself and progressive approach where the functions try to meet the base criteria in each iteration.

[quote]What is the Fibonacci series?[/quote]

Fibonacci Series generates subsequent number by adding two previous numbers. For example – 0 1 1 2 3 5 8 13.

[quote]What is the tower of Hanoi?[/quote]

Tower of Hanoi, is a mathematical puzzle which consists of three towers (pegs) and more than one rings. All rings are of different size and stacked upon each other where the large disk is always below the small disk. The aim is to move the tower of the disk from one peg to another, without breaking its properties.

Leave a Reply

Your email address will not be published. Required fields are marked *