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.
Questions
Choose the correct answer of the following (any seven) :
Answer the following:
Answer the following:
Insert the following numbers, in the given sequence, in an empty B tree of order 5 and display the tree at every split : 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1. Now delete the following elements from the tree, in the given sequence, and display the tree at every merge.
Insert the following numbers, in the given sequence, in an empty B+ tree of order 3 and display the tree at every split : 10, 20, 30, 90, 80, 60, 70, 40, 50, 66, 16, 84, 21, 76. Now delete the following elements from the tree, in the given sequence, and display the tree at every merge.
Answer the following:
Differentiate between the following :
Explain in detail the Kruskal's and Prim's algorithms for constructing minimum spanning tree. For the weighted undirected graph given below, construct the minimum cost spanning tree for the given graph using Kruskal's algorithm and Prim's algorithm when the starting vertex is R1 :
Define the following :
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.
Q.1 Choose the correct answer of the following (any seven):
Which of the following is time complexity of the given code?
$ int\ a=0; $
$ for(i=0; i< N; i++) \{ $
$ \quad for(j=N; j>i; j--) \{ $
$ \quad \quad a = a + i + j; $
$ \quad \} $
$ \} $
Which of the following is time complexity of the given code?
$ int\ i,\ j,\ k=0; $
$ for(i=n/2; i<=n; i++) \{ $
$ \quad for(j=2; j<=n; j=j*2) \{ $
$ \quad \quad k = k + n/2; $
$ \quad \} $
$ \} $
Which of the following cases does not exist in complexity theory?
The operation of processing each element in the list is known as
Arrays are best data structures
Each array declaration needs not give, implicitly or explicitly the information about
In general, the binary search method needs not more than
State True or False:
A. Binary search is used for searching in a sorted array.
B. The time
complexity of binary search is O(logn).
Which of the following is non-linear data structure?
Which is the correct output for the following sequence of operations? push(5), push(8), pop, push(2), push(5), pop, pop, pop, push(1), pop
Q.2 Solve this question :
Analyse the time complexity of the given function and also write the recurrence relation of the
function:
$ int\ DoSomething(int\ n) \{ $
$ \quad if(n<=2)\ return\ 1; $
$ \quad else\ return\ (DoSomething(floor(sqrt(n))) + n); $
$ \} $
Q.3 Solve this question :
Consider the following postfix expression : 873-/6254+*+-
The above expression is evaluated
using
stack. Show the content of stack after each step.
Q.4 Solve this question :
What are the different notations for comparing the time complexity of an algorithm? Explain each of them with neat figures.
Q.5 Solve this question :
Explain the queue and circular queue with examples. Also, write the differences between the two.
Q.6 Solve this question :
Let a and b be positive integers. Suppose a function F is defined recursively as follows:
$ F(a,b) = \begin{cases} 0 & \text{if } a < b \\ F(a-b,b) + 1 & \text{if } b \le a
\end{cases} $
Find the values of the following: (a) $ F(2,3) $ (b) $ F(14,3) $
Q.7 Solve both questions :
Write the algorithm of prefix evaluation with example.
Write prefix notation of the following infix notation: $ A+B*C+D $
Q.8 Solve this question :
What do you mean by ADT? Explain the ADT stack with test cases for both pop and push.
Q.9 Write short notes on the following:
Hashing
Circular linked list
Adjacency list
AVL tree
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.
Q.1 Choose the correct answer of the following (any seven):
Which of the following is time complexity of the given code?
$ int\ a=0; $
$ for(i=0; i< N; i++) \{ $
$ \quad for(j=N; j>i; j--) \{ $
$ \quad \quad a = a + i + j; $
$ \quad \} $
$ \} $
Which of the following is time complexity of the given code?
$ int\ i,\ j,\ k=0; $
$ for(i=n/2; i<=n; i++) \{ $
$ \quad for(j=2; j<=n; j=j*2) \{ $
$ \quad \quad k = k + n/2; $
$ \quad \} $
$ \} $
Which of the following cases does not exist in complexity theory?
The operation of processing each element in the list is known as
Arrays are best data structures
Each array declaration needs not give, implicitly or explicitly the information about
In general, the binary search method needs not more than
State True or False:
A. Binary search is used for searching in a sorted array.
B. The time
complexity of binary search is O(logn).
Which of the following is non-linear data structure?
Which is the correct output for the following sequence of operations? push(5), push(8), pop, push(2), push(5), pop, pop, pop, push(1), pop
Q.2 Solve this question :
Analyse the time complexity of the given function and also write the recurrence relation of the
function:
$ int\ DoSomething(int\ n) \{ $
$ \quad if(n<=2)\ return\ 1; $
$ \quad else\ return\ (DoSomething(floor(sqrt(n))) + n); $
$ \} $
Q.3 Solve this question :
Consider the following postfix expression : 873-/6254+*+-
The above expression is evaluated
using
stack. Show the content of stack after each step.
Q.4 Solve this question :
What are the different notations for comparing the time complexity of an algorithm? Explain each of them with neat figures.
Q.5 Solve this question :
Explain the queue and circular queue with examples. Also, write the differences between the two.
Q.6 Solve this question :
Let a and b be positive integers. Suppose a function F is defined recursively as follows:
$ F(a,b) = \begin{cases} 0 & \text{if } a < b \\ F(a-b,b) + 1 & \text{if } b \le a
\end{cases} $
Find the values of the following: (a) $ F(2,3) $ (b) $ F(14,3) $
Q.7 Solve both questions :
Write the algorithm of prefix evaluation with example.
Write prefix notation of the following infix notation: $ A+B*C+D $
Q.8 Solve this question :
What do you mean by ADT? Explain the ADT stack with test cases for both pop and push.
Q.9 Write short notes on the following:
Hashing
Circular linked list
Adjacency list
AVL tree
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.
Q.1 Choose the correct answer of the following (any seven):
If the number of records to be sorted is small, then ______ sorting can be efficient.
Which of the following is not a limitation of binary search algorithm?
The complexity of the merge sort is
Which of the following is a hash function?
In simple hashing, what is the search complexity?
In simple chaining, what data structure is appropriate?
Which is not true about insertion sort?
Which of the below mentioned sorting algorithms is not stable?
A pivot element to partition unsorted list is used in
Which one of the following is divide and conquer approach?
Q.2 Solve this question :
Write down breadth-first traversal and depth-first traversal of given graph taking 1 as source vertex.

Q.3 Solve this question :
Construct a B-tree with minimum degree t as 3 and a sequence of integers 10, 20, 30, 40, 50, 60, 70, 80 and 90 in an initially empty B-tree. Show each step.
Q.4 Solve this question :
Write a function to perform merge sort on array of element mentioned. Also write recurrence relation for time complexity of algorithm.
Q.5 Solve this question :
What is AVL tree? Describe deletion operation in AVL tree with example.
Q.6 Solve this question :
Apply bubble sort on given array of integers: 26, 45, 13, 23, 12, 7, 38, 42. Show the content of array after every pass.
Q.7 Solve this question :
Write the algorithm to count leaf node in binary tree and check whether the tree is balanced or not.
Q.8 Solve both questions :
What is hash table? How can we use this structure to find all anagrams in a dictionary?
Write a function that inserts a given element in a binary search tree. If the element is already present, throw an exception 'duplicate value'.
Q.9 Write short notes on the following:
Linear and non-linear data structures
How to implement stack using queue
Heapsort
C++ STL
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.
Q.1 Choose the correct answer of the following (any seven):
If the number of records to be sorted is small, then ______ sorting can be efficient.
Which of the following is not a limitation of binary search algorithm?
The complexity of the merge sort is
Which of the following is a hash function?
In simple hashing, what is the search complexity?
In simple chaining, what data structure is appropriate?
Which is not true about insertion sort?
Which of the below mentioned sorting algorithms is not stable?
A pivot element to partition unsorted list is used in
Which one of the following is divide and conquer approach?
Q.2 Solve this question :
Write down breadth-first traversal and depth-first traversal of given graph taking 1 as source vertex.

Q.3 Solve this question :
Construct a B-tree with minimum degree t as 3 and a sequence of integers 10, 20, 30, 40, 50, 60, 70, 80 and 90 in an initially empty B-tree. Show each step.
Q.4 Solve this question :
Write a function to perform merge sort on array of element mentioned. Also write recurrence relation for time complexity of algorithm.
Q.5 Solve this question :
What is AVL tree? Describe deletion operation in AVL tree with example.
Q.6 Solve this question :
Apply bubble sort on given array of integers: 26, 45, 13, 23, 12, 7, 38, 42. Show the content of array after every pass.
Q.7 Solve this question :
Write the algorithm to count leaf node in binary tree and check whether the tree is balanced or not.
Q.8 Solve both questions :
What is hash table? How can we use this structure to find all anagrams in a dictionary?
Write a function that inserts a given element in a binary search tree. If the element is already present, throw an exception 'duplicate value'.
Q.9 Write short notes on the following:
Linear and non-linear data structures
How to implement stack using queue
Heapsort
C++ STL
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.
Q.1 Choose the correct answer of any seven of the following
questions:
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
Q.2 Solve this question :
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?
Q.3 Solve this question :
Describe insertion in max heap tree with example from the following list of numbers: 33, 42, 67, 23, 44, 49, 74
Q.4 Solve this question :
Sort the given values using quicksort and write time complexity of algorithm: 65, 70, 75, 80, 85, 60, 55, 50, 45
Q.5 Solve both questions :
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.
Q.6 Solve both questions :
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.
Q.7 Solve this question :
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
Q.8 Solve both questions :
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.
Q.9 Write short notes on the following:
BFS
DFS
Binary search tree
Balance factor
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.
Q.1 Choose the correct answer of any seven of the following
questions:
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
Q.2 Solve this question :
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?
Q.3 Solve this question :
Describe insertion in max heap tree with example from the following list of numbers: 33, 42, 67, 23, 44, 49, 74
Q.4 Solve this question :
Sort the given values using quicksort and write time complexity of algorithm: 65, 70, 75, 80, 85, 60, 55, 50, 45
Q.5 Solve both questions :
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.
Q.6 Solve both questions :
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.
Q.7 Solve this question :
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
Q.8 Solve both questions :
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.
Q.9 Write short notes on the following:
BFS
DFS
Binary search tree
Balance factor