Data Structures and Algorithms - B.Tech 3rd Semester Exam., 2019 (New Course)
Data Structures and Algorithms
Instructions:
- The marks are indicated in the right-hand margin.
- There are NINE questions in this paper.
- Attempt FIVE questions in all.
- Question No. 1 is compulsory.
-
Which of the following points is/are true about linked list data structure when it is compared with array?
-
What is the functionality of the following code?
\( public\ void\ function(Node\ node)\ \{ \)
\( \quad if(size==0)\ head=node; \)
\( \quad else\ \{ \)
\( \quad \quad Node\ temp,\ cur; \)
\( \quad \quad for(cur=head; (temp=cur.getNext())! \) \(=null; cur=temp); \)
\( \quad \quad cur.setNext(node); \)
\( \quad \} \)
\( \quad size++; \)
\( \} \) -
What is the space complexity for deleting a linked list?
-
The situation when in a linked list START=NULL is
-
What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list?
-
What kind of linked list is best to answer question like "What is the item at position n"?
-
A variation of linked list is circular linked list, in which the last node in the list points to first node of the list. One problem with this type of list is
-
Each node in a linked list must contain at least
-
A linear list in which the last node points to the first node is
-
In a linked list, insertion can be done at
-
What is a Hash Table, and what is the average case and worst-case time for each of its operations? How can we use this structure to find all anagrams in a dictionary?
-
Describe insertion in max heap tree with example from the following list of numbers: 33, 42, 67, 23, 44, 49, 74
-
Sort the given values using quicksort and write time complexity of algorithm: 65, 70, 75, 80, 85, 60, 55, 50, 45
-
Insert the following sequence of elements into an AVL tree, starting with an empty tree: 10, 20, 15, 25, 30, 16, 18, 19
-
Delete 30 in the AVL tree that you got.
-
Write algorithm for quicksort and mention time and space complexity in each case.
-
Define collision in hashing. What are the different methodologies to resolve collision? Explain briefly.
-
Construct binary search tree and write pre- and post-order traversals of this tree: 8, 3, 1, 10, 6, 14, 4, 7, 13, 22, 5
-
Write algorithm to count leaf node in binary tree and check whether tree is balanced or not.
-
Write a recursive and iterative version of insertion sort algorithm and mention time complexity.
-
BFS
-
DFS
-
Binary search tree
-
Balance factor