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 question
only):
What is the time complexity of the following code snippet?
for(i=0; i<n; i++) {
for(j=0; j<i; j++) {
int sum = i + j;
}
}Which type of traversal of binary search tree outputs the value in sorted order?
Suppose a circular queue of capacity $ (n-1) $ elements is implemented with an array of n elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR=FRONT=0. The conditions to detect queue full and queue empty are
Which of the following data structures can be used for parentheses matching?
What is the worst-case time complexity of inserting n elements into an empty linked list, if the linked list needs to be maintained in sorted order?
What will be the postfix expression for the given infix expression: $ (a+b)*c-d $
What is the outcome of the prefix expression + - * 3 2 / 8 4 1 ?
Where will the new element be inserted in the linked list implementation of the queue?
Let us consider a list of numbers (34, 16, 2, 93, 80, 77, 51) and a hash table size of 10. What is the order of elements (from index 0 to size-1) in the hash table?
The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height h is:
Q.2 Solve both questions :
Why do we need an asymptotic notation? Explain the different asymptotic notations with definitions and examples.
Write the worst-case run time complexity of the following algorithms: linear search, bubble sort, merge sort, and push operation in the stack.
Q.3 Solve both questions :
Write push() and pop() functions of a stack.
Evaluate the following postfix expression using STACK. Show all the steps. 8, 2, /, 3, *, 4, -, 6, 2, /, +
Q.4 Solve both questions :
Write the algorithm to count the total elements in a singly linked list.
How a doubly linked list is better than a singly linked list? Explain deletion on a doubly linked list using an example.
Q.5 Solve both questions :
The following values are to be stored in a hash table: 25, 42, 96, 101, 102, 162, 197. Describe how the values are hashed by using the division method of hashing with a table size of 7. Use chaining as the method of collision resolution.
Apply the merge sort on the following numbers: 10, 15, 50, 17, 20, 25, 30, 16, 70, 6.
Q.6 Solve both questions :
Differentiate between stack and queue. Explain different types of queues with examples.
Write the properties of a binary search tree. Create a binary search tree using the following elements: 45, 15, 79, 90, 10, 55, 12, 20, 50.
Q.7 Solve both questions :
Consider the in-order and pre-order traversal of a binary search tree are (1, 2, 3, 4, 5, 6, 8, 10, 25) and (4, 3, 1, 2, 10, 8, 5, 6, 25) respectively. Construct a unique binary search tree for the given in-order and pre-order traversals.
Explain the insertion in the AVL tree using an example.
Q.8 Solve this question :
Explain the Heap sort algorithm. Create a heap for the following elements and then sort them: 13, 102, 405, 136, 15, 105, 390, 432, 28, 444.
Q.9 Write the short note on 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 question
only):
What is the time complexity of the following code snippet?
Which type of traversal of binary search tree outputs the value in sorted order?
Suppose a circular queue of capacity elements is implemented with an array of n elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR=FRONT=0. The conditions to detect queue full and queue empty are
Which of the following data structures can be used for parentheses matching?
What is the worst-case time complexity of inserting n elements into an empty linked list, if the linked list needs to be maintained in sorted order?
What will be the postfix expression for the given infix expression:
What is the outcome of the prefix expression + - * 3 2 / 8 4 1 ?
Where will the new element be inserted in the linked list implementation of the queue?
Let us consider a list of numbers (34, 16, 2, 93, 80, 77, 51) and a hash table size of 10. What is the order of elements (from index 0 to size-1) in the hash table?
The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height h is:
Q.2 Solve both questions :
Why do we need an asymptotic notation? Explain the different asymptotic notations with definitions and examples.
Write the worst-case run time complexity of the following algorithms: linear search, bubble sort, merge sort, and push operation in the stack.
Q.3 Solve both questions :
Write push() and pop() functions of a stack.
Evaluate the following postfix expression using STACK. Show all the steps. 8, 2, /, 3, *, 4, -, 6, 2, /, +
Q.4 Solve both questions :
Write the algorithm to count the total elements in a singly linked list.
How a doubly linked list is better than a singly linked list? Explain deletion on a doubly linked list using an example.
Q.5 Solve both questions :
The following values are to be stored in a hash table: 25, 42, 96, 101, 102, 162, 197. Describe how the values are hashed by using the division method of hashing with a table size of 7. Use chaining as the method of collision resolution.
Apply the merge sort on the following numbers: 10, 15, 50, 17, 20, 25, 30, 16, 70, 6.
Q.6 Solve both questions :
Differentiate between stack and queue. Explain different types of queues with examples.
Write the properties of a binary search tree. Create a binary search tree using the following elements: 45, 15, 79, 90, 10, 55, 12, 20, 50.
Q.7 Solve both questions :
Consider the in-order and pre-order traversal of a binary search tree are (1, 2, 3, 4, 5, 6, 8, 10, 25) and (4, 3, 1, 2, 10, 8, 5, 6, 25) respectively. Construct a unique binary search tree for the given in-order and pre-order traversals.
Explain the insertion in the AVL tree using an example.
Q.8 Solve this question :
Explain the Heap sort algorithm. Create a heap for the following elements and then sort them: 13, 102, 405, 136, 15, 105, 390, 432, 28, 444.
Q.9 Write the short note on 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 question
only):
In a stack, if a user tries to remove an element from empty stack it is called:
Consider the binary max-heap implemented using an array. Which one of the following array represents the heap:
A hash function is defined as h(key) = key mod 7, with linear probing used to insert keys 44, 45, 79, 55, 91, 18, 63 into a table indexed from 0 to 6. What will be the location of key 18?
If the number of values to be sorted is already partially sorted, then ______ sorting can be efficient.
The time complexity of merge sort is:
State true or false: A: Binary search is used for searching in a sorted array. B: The time complexity of binary search is $ O(\log n) $.
In a circular linked list organization, insertion of a record involves modification of:
Level order traversal of a rooted tree can be done by starting from the root and performing:
An Abstract Data Type (ADT) is:
How many distinct BSTs can be constructed with 3 distinct keys?
Q.2 Solve both questions :
Explain different asymptotic notations (Big-O, $ \Omega $, $ \Theta $) used for comparing the time complexity of an algorithm with neat figures.
The run time of an algorithm is represented by the recurrence relation $ T(n) = 2T(n/2) + n $; $ n \ge 2 $ and with boundary condition $ T(1) = 0 $. What is the time complexity (in terms of $ \Theta $ notation).
Q.3 Solve both questions :
Discuss pre-order, in-order and post-order traversal techniques of binary tree. Write a C function for non-recursive pre-order traversal.
The pre-order traversal sequence of a Binary Search Tree (BST) is 30, 20, 10, 15, 25, 23, 39, 35, 42. Write step by step process to derive the BST and find post-order traversal also.
Q.4 Solve both questions :
Consider a circular queue of capacity n-elements implemented with an array. Write C functions for insertion and deletion operations.
Convert the given infix expression into postfix using stack: $ A + B / C * (D + E) - F $. For each input symbol clearly mention the action taken and status of the stack during conversion.
Q.5 Solve both questions :
Write a C function to delete last node from a singly linked list.
Create a max-heap by inserting following keys in the given order. Show each insertion step with clear illustration: 25, 35, 18, 9, 46, 70, 48.
Q.6 Solve both questions :
Write an algorithm for merge sort and discuss space and time complexity.
Define collision in hashing. Explain briefly different methodologies to resolve collision.
Q.7 Solve both questions :
Write algorithm to count leaf nodes in binary tree. What is the complexity of your algorithm?
Compare BFS and DFS traversal techniques for graph. Write an algorithm to perform BFS using queue.
Q.8 Solve both questions :
Differentiate between system defined data types and abstract data types with suitable examples.
What is doubly linked list? What are its applications? Explain how a node can be added as last node using appropriate pseudo code.
Q.9 Write short notes on any two of the following:
AVL Rotations
Open Addressing & Chaining
B-Tree
Priority Queue
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 question
only):
In a stack, if a user tries to remove an element from empty stack it is called:
Consider the binary max-heap implemented using an array. Which one of the following array represents the heap:
A hash function is defined as h(key) = key mod 7, with linear probing used to insert keys 44, 45, 79, 55, 91, 18, 63 into a table indexed from 0 to 6. What will be the location of key 18?
If the number of values to be sorted is already partially sorted, then ______ sorting can be efficient.
The time complexity of merge sort is:
State true or false: A: Binary search is used for searching in a sorted array. B: The time complexity of binary search is $ O(\log n) $.
In a circular linked list organization, insertion of a record involves modification of:
Level order traversal of a rooted tree can be done by starting from the root and performing:
An Abstract Data Type (ADT) is:
How many distinct BSTs can be constructed with 3 distinct keys?
Q.2 Solve both questions :
Explain different asymptotic notations (Big-O, $ \Omega $, $ \Theta $) used for comparing the time complexity of an algorithm with neat figures.
The run time of an algorithm is represented by the recurrence relation $ T(n) = 2T(n/2) + n $; $ n \ge 2 $ and with boundary condition $ T(1) = 0 $. What is the time complexity (in terms of $ \Theta $ notation).
Q.3 Solve both questions :
Discuss pre-order, in-order and post-order traversal techniques of binary tree. Write a C function for non-recursive pre-order traversal.
The pre-order traversal sequence of a Binary Search Tree (BST) is 30, 20, 10, 15, 25, 23, 39, 35, 42. Write step by step process to derive the BST and find post-order traversal also.
Q.4 Solve both questions :
Consider a circular queue of capacity n-elements implemented with an array. Write C functions for insertion and deletion operations.
Convert the given infix expression into postfix using stack: $ A + B / C * (D + E) - F $. For each input symbol clearly mention the action taken and status of the stack during conversion.
Q.5 Solve both questions :
Write a C function to delete last node from a singly linked list.
Create a max-heap by inserting following keys in the given order. Show each insertion step with clear illustration: 25, 35, 18, 9, 46, 70, 48.
Q.6 Solve both questions :
Write an algorithm for merge sort and discuss space and time complexity.
Define collision in hashing. Explain briefly different methodologies to resolve collision.
Q.7 Solve both questions :
Write algorithm to count leaf nodes in binary tree. What is the complexity of your algorithm?
Compare BFS and DFS traversal techniques for graph. Write an algorithm to perform BFS using queue.
Q.8 Solve both questions :
Differentiate between system defined data types and abstract data types with suitable examples.
What is doubly linked list? What are its applications? Explain how a node can be added as last node using appropriate pseudo code.
Q.9 Write short notes on any two of the following:
AVL Rotations
Open Addressing & Chaining
B-Tree
Priority Queue
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.
Questions
Answer the following:
Which of the following best describes an array?
The process of removing an element from stack is called
In a stack, if a user tries to remove an element from empty stack it is called
A linear collection of data elements where the linear node is given by means of pointer is called
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?
With what data structure can a priority queue be implemented?
What is the functionality of the following piece of code?
public void fun(int x) {
q1.offer(x);
}
In a max-heap, element with the greatest key is always in which of the following nodes?
What is the specialty about the in-order traversal of a binary search tree?
Which of the following is not an application of priority queue?
Answer the following:
Explain array implementation of priority queues and list implementations of priority queues.
Differentiate between row major and column major array index notations. How is index calculated in both? Explain your answer by using the example of an integer array and the element is to be accessed.
Answer the following:
What is doubly linked list? What are its applications? Explain how an element can be deleted from the list using appropriate pseudocode.
Consider two strings and , where and are the members of finite set symbols. Write an algorithm to generate a string by taking 1 element from each list. When any one string is exhausted, the output string should store rest of the elements of other string.
Answer the following:
What do you understand by 'garbage'? Explain how garbage collection method is used for allocating and freeing memory storage.
Suppose the following eight numbers are inserted in order into an empty binary search tree: $T : 50, 33, 44, 22, 77, 35, 60, 40$ Draw the tree T.
Answer the following:
Discuss pre-order and post-order tree traversal techniques. Write the pseudo-code for these two traversal methods.
Write the algorithms for insertion sort and merge sort with examples and discuss their complexities.
Answer the following:
Write an algorithm to perform breadth first search (BFS). Compare the BFS and DFS search techniques.
Explain the working of merge sort on the following data: ${10, 15, 0, 17, 20, 25, 30, 16, 70, 6}$ Show all intermediate steps. Also, mention its time complexity.
Answer the following:
What is meant by a spanning tree of a graph? Give an algorithm to find a spanning tree. What is the complexity of your algorithm?
What do you mean by tree traversal? Give a recursive algorithm for tree traversal. Determine the complexity of your algorithm.
Answer the following:
Algorithm A requires days and algorithm B requires sec to solve a problem. Which algorithm would you prefer for a problem instance with ?
Assume the recurrence relation with boundary condition . What is the time complexity?
Answer the following:
Write short notes on 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 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
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
Answer the following:
How many number of interchanges are required to sort 5, 1, 6 in ascending order using Bubble sort?
What is the postfix form of the expression ?
How many leaf nodes are present in a full binary tree with nodes?
A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as .............
What is LIFO?
What are the minimum number of multiplications and additions required to evaluate the given polynomial ?
Which of the following sorting methods would be most suitable for sorting a list which is almost sorted?
What values are automatically assigned to those array elements which are not explicitly initialized?
What is the time complexity of Merge sort and Heap sort algorithms?
What is complete binary Tree?
Answer the following:
What is Binary Search Tree (BST)? Make a BST for the following sequence of numbers. 45, 36, 76, 23, 89, 115, 98, 39, 41, 56, 69, 48 Traverse the tree in Preorder, Inorder and Postorder.
Answer the following:
What is an algorithm? What are the characteristics of a good algorithm?
What is a sparse matrix? How is it stored in the memory of a computer?
Answer the following:
Describe about the doubly linked list with an example. Write the advantages of linked list over array.
Show the various passes of bubble sort on an unsorted list 11, 15, 2, 13, 6
Answer the following:
Define a stack. Describe ways to implement stack.
Differentiate between system defined data types and abstract data types with suitable examples.
Answer the following:
Describe insertion sort with a proper algorithm. What is the complexity of insertion sort in worst case?
Write an algorithm to insert a node in the beginning of the linked list.
Answer the following:
For the given Binary Search Tree, perform the following sequence of operations: (A) Delete 44 (B) Delete 75 (C) Delete 25
Write down the applications of stack and queue data structures.
Answer the following:
Construct a binary tree whose nodes on inorder and preorder are given as follows: Inorder: 10, 15, 17, 18, 20, 25, 30, 35, 38, 40, 50 Preorder: 20, 15, 10, 18, 17, 30, 25, 40, 35, 38, 50
What do you mean by hashing? Explain any three popular hash functions.
Answer the following:
Write short notes on following (any two):
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
Answer the following:
There are 8, 15, 13 and 14 nodes in four different trees. Which one of them can form a full binary tree?
Which data structure is used to perform recursion and why?
List out the areas in which data structures are applied extensively.
Sorting is not possible by using which of the following methods and why? Insertion, Selection, Exchange, Deletion
What is FIFO?
What is a postfix expression?
Differentiate between linear and non-linear data structures.
How do you insert a new item in a binary search tree?
Differentiate between stack and array.
What is an AVL tree?
Answer the following:
Write binary search algorithm and trace to search element 91 in the following list: 13, 30, 62, 73, 81, 88, 91
What are the limitations of binary search?
Answer the following:
Draw a binary tree from its inorder and preorder traversal sequences given as follows: Inorder: d b g e h a c n f Preorder: a b d e g h c f n
What is stack? How can stack be used to check whether an expression is correctly parenthesized or not? [Hint: () is correct but (( or )()( is not]
Answer the following:
Convert the following infix expression into a postfix expression (show steps): $A * (B+D) / E - F(G + H/k)$
How do you find the complexity of an algorithm? What is the relation between the time and the space complexities of an algorithm?
Answer the following:
Write an algorithm to create a singly linked list. Explain the steps to do the following operations:
Answer the following:
Arrange the given list of elements in ascending order using quick sort: 44, 33, 11, 55, 77, 90, 40, 60, 99, 22, 88, 66
Define an array. How does an array differ from an ordinary variable? How are arrays represented in the memory?
Answer the following:
Define hashing. Describe any two commonly used hash functions. Describe one method of collision resolution.
Answer the following:
Write down the procedure for inserting and deleting elements from a circular queue implemented using arrays.
What is a height balanced tree? Explain how the height is balanced after addition/deletion of nodes in it.
Answer the following:
Write short notes on any two 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.
Questions
Answer the following:
If the sequence of operations—push(1), push(2), pop, push(1), push(2), pop, pop, pop, push(2), pop are performed on a stack, the sequence of popped out values is
Queue can be used to implement
The number of binary trees with 3 nodes which when traversed in post-order gives the sequence A, B, C is
A binary tree has leaf nodes. The number of nodes of degree 2 in this tree is
Sparse matrices have
The postfix expression for is
The memory address of the first element of an array is called
The memory address of fifth element of an array can be calculated by the formula
Which of the following data structures are indexed structures?
Which of the following is not the required condition for binary search algorithm?
Answer the following:
What is a data structure? What is the need of data structures?
Explain Big-Oh notation with the help of example.
Answer the following:
Write suitable array declaration for the following:
- 100 items of integer type
- A string of 25 characters
- An integer matrix of order Can an array be initialized? If yes, how?
Write a program that sorts a given list of numbers using quicksort.
Answer the following:
Explain overflow and underflow conditions of a stack with examples.
What are priority queues? Write their applications.
Answer the following:
Write a program that travels a linked list consisting of nodes of the following struct type:
struct student {
char name[15];
int roll;
struct student *next;
};
While traversing, it counts the number of nodes in the list. Finally, the count is printed.
Explain the merits and demerits of static and dynamic memory allocation techniques.
Answer the following:
Define the following terms: (i) Root (ii) Leaf nodes (iii) Empty tree (iv) Sub-tree
What are heap trees? Discuss a minheap and a maxheap tree with the help of examples. What are the operations that can be performed on a heap tree?
Answer the following:
Explain the following graph theory terms: (i) Node (ii) Undirected graph (iii) Edge (iv) Connected graph (v) Directed graph (vi) Disconnected graph
Write the Warshall's algorithm.
Answer the following:
Write an explanatory note on AVL rotations.
Write an algorithm for inserting a key K in a B-tree.
Answer the following:
What is a sparse matrix? What are the methods to represent a sparse matrix?
Use a stack to convert the following infix arithmetic expression into a postfix expression: $(A-B)*(C/D)+E$ Show the changing status of the stack in tabular form.