Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Data Structures Interview Questions

Data Structures Interview Questions

Ratings: (0)|Views: 14 |Likes:
Published by Sahil Parmar

More info:

Published by: Sahil Parmar on Jul 04, 2012
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less





DATA STRUCTURES QUESTIONS(1) Reversing a linked list(2) Traversals of binary tree(3) traversals of graph(4) Time complexity(5) deleting a node from a binary search tree(6) What data structure will you use for DFS,BFS?(7) Various sorting techniques. Write algo for any sorting.(10) What is hashing?(11) How do u detect a loop in a linked list?(12) Which sorting technique has the least worst case?--> heap sort.(13) code for Tower of Hanoi(14) Prefix and Postfix(15) Multiplication of number ( Recusive)Ans:a*b=a if b==1a*b=a * (b-1) + a if b>1(16) Recusive solution (trace the stack)(17) Preorder and postorder traversals(18) How to check out that graph is connected or not?(19) A binary search tree is given. Tell the 4th smallest value in it.(20) How can you insert different types of elements in one stack? We know the various types of elements that can be stored on the stack.(21) How will you sort a linked list?
(22) A list is ordered from smaller to largest when a sort is called. Which sort would take the shortesttime to execute?(23) There are 8, 15, 13, and 14 nodes in 4 different trees. Which one of them can form a full binarytree?(24) Write code to sort a list such that all odd numbers come first, then all even numbers.(25) Deleting a node when a given a pointer only to that node, deleting last node in this case(26) How to read a singly linked list backwards?a: Using recursion
void display_reverse(struct node *head){if(head->next != NULL)display_reverse(head->next);else{printf("\t%d",head->data);return;}}
 (27) AVL tree rotations(28) How to represent binary tree, complete binary tree and full binary tree?(29) B, B+ tree(30) reversing, sorting, implementing priority queue, contrast with an array, which type is suitable for a queue, dequeue?, finding loop in a LL, merging 2LL.(31) Find the common node in intersecting linked lists. (soln: let L1 and L2 be the lengths of thelarger and smaller lists. Traverse L1-L2 node fromlarger list. Now the common node is equidistant from current ptrs)(32) Find the mid point of a link list w/o using counters. ( soln : take 2 ptr.. shift one by one node...and other by two nodes)(33) list the members of BST in descending order.((34) Tree traversals ---> inorder , preorder , postorder , converse preorder ,converse inorder ,converse postorder , double order (35) number of possible binary tree with 3 nodes ---> 54 nodes ---> 12

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->