Data Structure & Algorithms
2023100304
B.Tech. 3rd Semester Examination, 2023
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):
Ask AI
Q1.1
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; } }Ask AI
Q1.2
Which type of traversal of binary search tree outputs the value in sorted order?
Ask AI
Q1.3
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
Ask AI
Q1.4
Which of the following data structures can be used for parentheses matching?
Ask AI
Q1.5
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?
Ask AI
Q1.6
What will be the postfix expression for the given infix expression: $ (a+b)*c-d $
Ask AI
Q1.7
What is the outcome of the prefix expression + - * 3 2 / 8 4 1 ?
Ask AI
Q1.8
Where will the new element be inserted in the linked list implementation of the queue?
Ask AI
Q1.9
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?
Ask AI
Q1.10
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:
Ask AI
Q.2 Solve both questions :
Ask AI
Q2.1
Why do we need an asymptotic notation? Explain the different asymptotic notations with definitions and examples.
Ask AI
Q2.2
Write the worst-case run time complexity of the following algorithms: linear search, bubble sort, merge sort, and push operation in the stack.
Ask AI
Q.3 Solve both questions :
Ask AI
Q3.1
Write push() and pop() functions of a stack.
Ask AI
Q3.2
Evaluate the following postfix expression using STACK. Show all the steps. 8, 2, /, 3, *, 4, -, 6, 2, /, +
Ask AI
Q.4 Solve both questions :
Ask AI
Q4.1
Write the algorithm to count the total elements in a singly linked list.
Ask AI
Q4.2
How a doubly linked list is better than a singly linked list? Explain deletion on a doubly linked list using an example.
Ask AI
Q.5 Solve both questions :
Ask AI
Q5.1
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.
Ask AI
Q5.2
Apply the merge sort on the following numbers: 10, 15, 50, 17, 20, 25, 30, 16, 70, 6.
Ask AI
Q.6 Solve both questions :
Ask AI
Q6.1
Differentiate between stack and queue. Explain different types of queues with examples.
Ask AI
Q6.2
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.
Ask AI
Q.7 Solve both questions :
Ask AI
Q7.1
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.
Ask AI
Q7.2
Explain the insertion in the AVL tree using an example.
Ask AI
Q.8 Solve this question :
Ask AI
Q8.1
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.
Ask AI
Q.9 Write the short note on the following:
Ask AI
Q9.1
Ask AI
2023V2100304
B.Tech. 3rd Semester Examination, 2023
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):
Ask AI
Q1.1
What is the time complexity of the following code snippet?
Ask AI
Q1.2
Which type of traversal of binary search tree outputs the value in sorted order?
Ask AI
Q1.3
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
Ask AI
Q1.4
Which of the following data structures can be used for parentheses matching?
Ask AI
Q1.5
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?
Ask AI
Q1.6
What will be the postfix expression for the given infix expression:
Ask AI
Q1.7
What is the outcome of the prefix expression + - * 3 2 / 8 4 1 ?
Ask AI
Q1.8
Where will the new element be inserted in the linked list implementation of the queue?
Ask AI
Q1.9
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?
Ask AI
Q1.10
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:
Ask AI
Q.2 Solve both questions :
Ask AI
Q2.1
Why do we need an asymptotic notation? Explain the different asymptotic notations with definitions and examples.
Ask AI
Q2.2
Write the worst-case run time complexity of the following algorithms: linear search, bubble sort, merge sort, and push operation in the stack.
Ask AI
Q.3 Solve both questions :
Ask AI
Q3.1
Write push() and pop() functions of a stack.
Ask AI
Q3.2
Evaluate the following postfix expression using STACK. Show all the steps. 8, 2, /, 3, *, 4, -, 6, 2, /, +
Ask AI
Q.4 Solve both questions :
Ask AI
Q4.1
Write the algorithm to count the total elements in a singly linked list.
Ask AI
Q4.2
How a doubly linked list is better than a singly linked list? Explain deletion on a doubly linked list using an example.
Ask AI
Q.5 Solve both questions :
Ask AI
Q5.1
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.
Ask AI
Q5.2
Apply the merge sort on the following numbers: 10, 15, 50, 17, 20, 25, 30, 16, 70, 6.
Ask AI
Q.6 Solve both questions :
Ask AI
Q6.1
Differentiate between stack and queue. Explain different types of queues with examples.
Ask AI
Q6.2
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.
Ask AI
Q.7 Solve both questions :
Ask AI
Q7.1
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.
Ask AI
Q7.2
Explain the insertion in the AVL tree using an example.
Ask AI
Q.8 Solve this question :
Ask AI
Q8.1
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.
Ask AI
Q.9 Write the short note on the following:
Ask AI
Q9.1
Ask AI
2022100304
End Semester Examination - 2022
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):
Ask AI
Q1.1
In a stack, if a user tries to remove an element from empty stack it is called:
Ask AI
Q1.2
Consider the binary max-heap implemented using an array. Which one of the following array represents the heap:
Ask AI
Q1.3
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?
Ask AI
Q1.4
If the number of values to be sorted is already partially sorted, then ______ sorting can be efficient.
Ask AI
Q1.5
The time complexity of merge sort is:
Ask AI
Q1.6
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) $.
Ask AI
Q1.7
In a circular linked list organization, insertion of a record involves modification of:
Ask AI
Q1.8
Level order traversal of a rooted tree can be done by starting from the root and performing:
Ask AI
Q1.9
An Abstract Data Type (ADT) is:
Ask AI
Q1.10
How many distinct BSTs can be constructed with 3 distinct keys?
Ask AI
Q.2 Solve both questions :
Ask AI
Q2.1
Explain different asymptotic notations (Big-O, $ \Omega $, $ \Theta $) used for comparing the time complexity of an algorithm with neat figures.
Ask AI
Q2.2
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).
Ask AI
Q.3 Solve both questions :
Ask AI
Q3.1
Discuss pre-order, in-order and post-order traversal techniques of binary tree. Write a C function for non-recursive pre-order traversal.
Ask AI
Q3.2
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.
Ask AI
Q.4 Solve both questions :
Ask AI
Q4.1
Consider a circular queue of capacity n-elements implemented with an array. Write C functions for insertion and deletion operations.
Ask AI
Q4.2
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.
Ask AI
Q.5 Solve both questions :
Ask AI
Q5.1
Write a C function to delete last node from a singly linked list.
Ask AI
Q5.2
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.
Ask AI
Q.6 Solve both questions :
Ask AI
Q6.1
Write an algorithm for merge sort and discuss space and time complexity.
Ask AI
Q6.2
Define collision in hashing. Explain briefly different methodologies to resolve collision.
Ask AI
Q.7 Solve both questions :
Ask AI
Q7.1
Write algorithm to count leaf nodes in binary tree. What is the complexity of your algorithm?
Ask AI
Q7.2
Compare BFS and DFS traversal techniques for graph. Write an algorithm to perform BFS using queue.
Ask AI
Q.8 Solve both questions :
Ask AI
Q8.1
Differentiate between system defined data types and abstract data types with suitable examples.
Ask AI
Q8.2
What is doubly linked list? What are its applications? Explain how a node can be added as last node using appropriate pseudo code.
Ask AI
Q.9 Write short notes on any two of the following:
Ask AI
Q9.1
AVL Rotations
Ask AI
Q9.2
Open Addressing & Chaining
Ask AI
Q9.3
B-Tree
Ask AI
Q9.4
Priority Queue
Ask AI
2022V4100304
End Semester Examination - 2022
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):
Ask AI
Q1.1
In a stack, if a user tries to remove an element from empty stack it is called:
Ask AI
Q1.2
Consider the binary max-heap implemented using an array. Which one of the following array represents the heap:
Ask AI
Q1.3
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?
Ask AI
Q1.4
If the number of values to be sorted is already partially sorted, then ______ sorting can be efficient.
Ask AI
Q1.5
The time complexity of merge sort is:
Ask AI
Q1.6
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) $.
Ask AI
Q1.7
In a circular linked list organization, insertion of a record involves modification of:
Ask AI
Q1.8
Level order traversal of a rooted tree can be done by starting from the root and performing:
Ask AI
Q1.9
An Abstract Data Type (ADT) is:
Ask AI
Q1.10
How many distinct BSTs can be constructed with 3 distinct keys?
Ask AI
Q.2 Solve both questions :
Ask AI
Q2.1
Explain different asymptotic notations (Big-O, $ \Omega $, $ \Theta $) used for comparing the time complexity of an algorithm with neat figures.
Ask AI
Q2.2
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).
Ask AI
Q.3 Solve both questions :
Ask AI
Q3.1
Discuss pre-order, in-order and post-order traversal techniques of binary tree. Write a C function for non-recursive pre-order traversal.
Ask AI
Q3.2
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.
Ask AI
Q.4 Solve both questions :
Ask AI
Q4.1
Consider a circular queue of capacity n-elements implemented with an array. Write C functions for insertion and deletion operations.
Ask AI
Q4.2
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.
Ask AI
Q.5 Solve both questions :
Ask AI
Q5.1
Write a C function to delete last node from a singly linked list.
Ask AI
Q5.2
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.
Ask AI
Q.6 Solve both questions :
Ask AI
Q6.1
Write an algorithm for merge sort and discuss space and time complexity.
Ask AI
Q6.2
Define collision in hashing. Explain briefly different methodologies to resolve collision.
Ask AI
Q.7 Solve both questions :
Ask AI
Q7.1
Write algorithm to count leaf nodes in binary tree. What is the complexity of your algorithm?
Ask AI
Q7.2
Compare BFS and DFS traversal techniques for graph. Write an algorithm to perform BFS using queue.
Ask AI
Q.8 Solve both questions :
Ask AI
Q8.1
Differentiate between system defined data types and abstract data types with suitable examples.
Ask AI
Q8.2
What is doubly linked list? What are its applications? Explain how a node can be added as last node using appropriate pseudo code.
Ask AI
Q.9 Write short notes on any two of the following:
Ask AI
Q9.1
AVL Rotations
Ask AI
Q9.2
Open Addressing & Chaining
Ask AI
Q9.3
B-Tree
Ask AI
Q9.4
Priority Queue
Ask AI
2021100304
B.Tech Examination, 2021
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
Ask AI
Q1
Choose the correct answer of the following (any seven) :
Ask AI
Q2
Answer the following:
Ask AI
Q3
Answer the following:
Ask AI
Q4
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.
14 marksAsk AI
Q5
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.
14 marksAsk AI
Q6
Answer the following:
Ask AI
Q7
Differentiate between the following :
Ask AI
Q8
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 :
14 marksAsk AI
Q9
Define the following :
Ask AI
2020100304
B.Tech 3rd Semester Exam., 2020 (New Course)
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):
Ask AI
Q1.1
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 \} $
$ \} $Ask AI
Q1.2
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 \} $
$ \} $Ask AI
Q1.3
Which of the following cases does not exist in complexity theory?
Ask AI
Q1.4
The operation of processing each element in the list is known as
Ask AI
Q1.5
Arrays are best data structures
Ask AI
Q1.6
Each array declaration needs not give, implicitly or explicitly the information about
Ask AI
Q1.7
In general, the binary search method needs not more than
Ask AI
Q1.8
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).Ask AI
Q1.9
Which of the following is non-linear data structure?
Ask AI
Q1.10
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
Ask AI
Q.2 Solve this question :
Ask AI
Q2.1
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); $
$ \} $Ask AI
Q.3 Solve this question :
Ask AI
Q3.1
Consider the following postfix expression : 873-/6254+*+-
The above expression is evaluated using stack. Show the content of stack after each step.Ask AI
Q.4 Solve this question :
Ask AI
Q4.1
What are the different notations for comparing the time complexity of an algorithm? Explain each of them with neat figures.
Ask AI
Q.5 Solve this question :
Ask AI
Q5.1
Explain the queue and circular queue with examples. Also, write the differences between the two.
Ask AI
Q.6 Solve this question :
Ask AI
Q6.1
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) $Ask AI
Q.7 Solve both questions :
Ask AI
Q7.1
Write the algorithm of prefix evaluation with example.
Ask AI
Q7.2
Write prefix notation of the following infix notation: $ A+B*C+D $
Ask AI
Q.8 Solve this question :
Ask AI
Q8.1
What do you mean by ADT? Explain the ADT stack with test cases for both pop and push.
Ask AI
Q.9 Write short notes on the following:
Ask AI
Q9.1
Hashing
Ask AI
Q9.2
Circular linked list
Ask AI
Q9.3
Adjacency list
Ask AI
Q9.4
AVL tree
Ask AI
2020V4100304
B.Tech 3rd Semester Exam., 2020 (New Course)
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):
Ask AI
Q1.1
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 \} $
$ \} $Ask AI
Q1.2
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 \} $
$ \} $Ask AI
Q1.3
Which of the following cases does not exist in complexity theory?
Ask AI
Q1.4
The operation of processing each element in the list is known as
Ask AI
Q1.5
Arrays are best data structures
Ask AI
Q1.6
Each array declaration needs not give, implicitly or explicitly the information about
Ask AI
Q1.7
In general, the binary search method needs not more than
Ask AI
Q1.8
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).Ask AI
Q1.9
Which of the following is non-linear data structure?
Ask AI
Q1.10
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
Ask AI
Q.2 Solve this question :
Ask AI
Q2.1
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); $
$ \} $Ask AI
Q.3 Solve this question :
Ask AI
Q3.1
Consider the following postfix expression : 873-/6254+*+-
The above expression is evaluated using stack. Show the content of stack after each step.Ask AI
Q.4 Solve this question :
Ask AI
Q4.1
What are the different notations for comparing the time complexity of an algorithm? Explain each of them with neat figures.
Ask AI
Q.5 Solve this question :
Ask AI
Q5.1
Explain the queue and circular queue with examples. Also, write the differences between the two.
Ask AI
Q.6 Solve this question :
Ask AI
Q6.1
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) $Ask AI
Q.7 Solve both questions :
Ask AI
Q7.1
Write the algorithm of prefix evaluation with example.
Ask AI
Q7.2
Write prefix notation of the following infix notation: $ A+B*C+D $
Ask AI
Q.8 Solve this question :
Ask AI
Q8.1
What do you mean by ADT? Explain the ADT stack with test cases for both pop and push.
Ask AI
Q.9 Write short notes on the following:
Ask AI
Q9.1
Hashing
Ask AI
Q9.2
Circular linked list
Ask AI
Q9.3
Adjacency list
Ask AI
Q9.4
AVL tree
Ask AI
2020PCC-IT-302 (100304)
B.Tech 3rd Semester Special Exam., 2020
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):
Ask AI
Q1.1
If the number of records to be sorted is small, then ______ sorting can be efficient.
Ask AI
Q1.2
Which of the following is not a limitation of binary search algorithm?
Ask AI
Q1.3
The complexity of the merge sort is
Ask AI
Q1.4
Which of the following is a hash function?
Ask AI
Q1.5
In simple hashing, what is the search complexity?
Ask AI
Q1.6
In simple chaining, what data structure is appropriate?
Ask AI
Q1.7
Which is not true about insertion sort?
Ask AI
Q1.8
Which of the below mentioned sorting algorithms is not stable?
Ask AI
Q1.9
A pivot element to partition unsorted list is used in
Ask AI
Q1.10
Which one of the following is divide and conquer approach?
Ask AI
Q.2 Solve this question :
Ask AI
Q2.1
Write down breadth-first traversal and depth-first traversal of given graph taking 1 as source vertex.

Ask AI
Q.3 Solve this question :
Ask AI
Q3.1
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.
Ask AI
Q.4 Solve this question :
Ask AI
Q4.1
Write a function to perform merge sort on array of element mentioned. Also write recurrence relation for time complexity of algorithm.
Ask AI
Q.5 Solve this question :
Ask AI
Q5.1
What is AVL tree? Describe deletion operation in AVL tree with example.
Ask AI
Q.6 Solve this question :
Ask AI
Q6.1
Apply bubble sort on given array of integers: 26, 45, 13, 23, 12, 7, 38, 42. Show the content of array after every pass.
Ask AI
Q.7 Solve this question :
Ask AI
Q7.1
Write the algorithm to count leaf node in binary tree and check whether the tree is balanced or not.
Ask AI
Q.8 Solve both questions :
Ask AI
Q8.1
What is hash table? How can we use this structure to find all anagrams in a dictionary?
Ask AI
Q8.2
Write a function that inserts a given element in a binary search tree. If the element is already present, throw an exception 'duplicate value'.
Ask AI
Q.9 Write short notes on the following:
Ask AI
Q9.1
Linear and non-linear data structures
Ask AI
Q9.2
How to implement stack using queue
Ask AI
Q9.3
Heapsort
Ask AI
Q9.4
C++ STL
Ask AI
2020SPECIALPCC-IT-302 (100304)
B.Tech 3rd Semester Special Exam., 2020
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):
Ask AI
Q1.1
If the number of records to be sorted is small, then ______ sorting can be efficient.
Ask AI
Q1.2
Which of the following is not a limitation of binary search algorithm?
Ask AI
Q1.3
The complexity of the merge sort is
Ask AI
Q1.4
Which of the following is a hash function?
Ask AI
Q1.5
In simple hashing, what is the search complexity?
Ask AI
Q1.6
In simple chaining, what data structure is appropriate?
Ask AI
Q1.7
Which is not true about insertion sort?
Ask AI
Q1.8
Which of the below mentioned sorting algorithms is not stable?
Ask AI
Q1.9
A pivot element to partition unsorted list is used in
Ask AI
Q1.10
Which one of the following is divide and conquer approach?
Ask AI
Q.2 Solve this question :
Ask AI
Q2.1
Write down breadth-first traversal and depth-first traversal of given graph taking 1 as source vertex.

Ask AI
Q.3 Solve this question :
Ask AI
Q3.1
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.
Ask AI
Q.4 Solve this question :
Ask AI
Q4.1
Write a function to perform merge sort on array of element mentioned. Also write recurrence relation for time complexity of algorithm.
Ask AI
Q.5 Solve this question :
Ask AI
Q5.1
What is AVL tree? Describe deletion operation in AVL tree with example.
Ask AI
Q.6 Solve this question :
Ask AI
Q6.1
Apply bubble sort on given array of integers: 26, 45, 13, 23, 12, 7, 38, 42. Show the content of array after every pass.
Ask AI
Q.7 Solve this question :
Ask AI
Q7.1
Write the algorithm to count leaf node in binary tree and check whether the tree is balanced or not.
Ask AI
Q.8 Solve both questions :
Ask AI
Q8.1
What is hash table? How can we use this structure to find all anagrams in a dictionary?
Ask AI
Q8.2
Write a function that inserts a given element in a binary search tree. If the element is already present, throw an exception 'duplicate value'.
Ask AI
Q.9 Write short notes on the following:
Ask AI
Q9.1
Linear and non-linear data structures
Ask AI
Q9.2
How to implement stack using queue
Ask AI
Q9.3
Heapsort
Ask AI
Q9.4
C++ STL
Ask AI
2019051403
B.Tech Examination, 2019
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
Ask AI
Q1
Answer the following:
a)2 marksWhich of the following best describes an array?
b)2 marksThe process of removing an element from stack is called
c)2 marksIn a stack, if a user tries to remove an element from empty stack it is called
d)2 marksA linear collection of data elements where the linear node is given by means of pointer is called
e)2 marksWhat 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?
f)2 marksWith what data structure can a priority queue be implemented?
g)2 marksWhat is the functionality of the following piece of code?
public void fun(int x) { q1.offer(x); }h)2 marksIn a max-heap, element with the greatest key is always in which of the following nodes?
i)2 marksWhat is the specialty about the in-order traversal of a binary search tree?
j)2 marksWhich of the following is not an application of priority queue?
Ask AI
Q2
Answer the following:
a)7 marksExplain array implementation of priority queues and list implementations of priority queues.
b)7 marksDifferentiate 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.
Ask AI
Q3
Answer the following:
a)7 marksWhat is doubly linked list? What are its applications? Explain how an element can be deleted from the list using appropriate pseudocode.
b)7 marksConsider 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.
Ask AI
Q4
Answer the following:
a)7 marksWhat do you understand by 'garbage'? Explain how garbage collection method is used for allocating and freeing memory storage.
b)7 marksSuppose 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.
Ask AI
Q5
Answer the following:
a)7 marksDiscuss pre-order and post-order tree traversal techniques. Write the pseudo-code for these two traversal methods.
b)7 marksWrite the algorithms for insertion sort and merge sort with examples and discuss their complexities.
Ask AI
Q6
Answer the following:
a)7 marksWrite an algorithm to perform breadth first search (BFS). Compare the BFS and DFS search techniques.
b)7 marksExplain 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.
Ask AI
Q7
Answer the following:
a)7 marksWhat is meant by a spanning tree of a graph? Give an algorithm to find a spanning tree. What is the complexity of your algorithm?
b)7 marksWhat do you mean by tree traversal? Give a recursive algorithm for tree traversal. Determine the complexity of your algorithm.
Ask AI
Q8
Answer the following:
a)7 marksAlgorithm A requires days and algorithm B requires sec to solve a problem. Which algorithm would you prefer for a problem instance with ?
b)7 marksAssume the recurrence relation with boundary condition . What is the time complexity?
Ask AI
Q9
Answer the following:
a)14 marksWrite short notes on the following:
Ask AI
2019100304
B.Tech 3rd Semester Exam., 2019 (New Course)
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:
Ask AI
Q1.1
Which of the following points is/are true about linked list data structure when it is compared with array?
Ask AI
Q1.2
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++; $
$ \} $Ask AI
Q1.3
What is the space complexity for deleting a linked list?
Ask AI
Q1.4
The situation when in a linked list START=NULL is
Ask AI
Q1.5
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?
Ask AI
Q1.6
What kind of linked list is best to answer question like "What is the item at position n"?
Ask AI
Q1.7
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
Ask AI
Q1.8
Each node in a linked list must contain at least
Ask AI
Q1.9
A linear list in which the last node points to the first node is
Ask AI
Q1.10
In a linked list, insertion can be done at
Ask AI
Q.2 Solve this question :
Ask AI
Q2.1
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?
Ask AI
Q.3 Solve this question :
Ask AI
Q3.1
Describe insertion in max heap tree with example from the following list of numbers: 33, 42, 67, 23, 44, 49, 74
Ask AI
Q.4 Solve this question :
Ask AI
Q4.1
Sort the given values using quicksort and write time complexity of algorithm: 65, 70, 75, 80, 85, 60, 55, 50, 45
Ask AI
Q.5 Solve both questions :
Ask AI
Q5.1
Insert the following sequence of elements into an AVL tree, starting with an empty tree: 10, 20, 15, 25, 30, 16, 18, 19
Ask AI
Q5.2
Delete 30 in the AVL tree that you got.
Ask AI
Q.6 Solve both questions :
Ask AI
Q6.1
Write algorithm for quicksort and mention time and space complexity in each case.
Ask AI
Q6.2
Define collision in hashing. What are the different methodologies to resolve collision? Explain briefly.
Ask AI
Q.7 Solve this question :
Ask AI
Q7.1
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
Ask AI
Q.8 Solve both questions :
Ask AI
Q8.1
Write algorithm to count leaf node in binary tree and check whether tree is balanced or not.
Ask AI
Q8.2
Write a recursive and iterative version of insertion sort algorithm and mention time complexity.
Ask AI
Q.9 Write short notes on the following:
Ask AI
Q9.1
BFS
Ask AI
Q9.2
DFS
Ask AI
Q9.3
Binary search tree
Ask AI
Q9.4
Balance factor
Ask AI
2019V4100304
B.Tech 3rd Semester Exam., 2019 (New Course)
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:
Ask AI
Q1.1
Which of the following points is/are true about linked list data structure when it is compared with array?
Ask AI
Q1.2
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++; $
$ \} $Ask AI
Q1.3
What is the space complexity for deleting a linked list?
Ask AI
Q1.4
The situation when in a linked list START=NULL is
Ask AI
Q1.5
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?
Ask AI
Q1.6
What kind of linked list is best to answer question like "What is the item at position n"?
Ask AI
Q1.7
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
Ask AI
Q1.8
Each node in a linked list must contain at least
Ask AI
Q1.9
A linear list in which the last node points to the first node is
Ask AI
Q1.10
In a linked list, insertion can be done at
Ask AI
Q.2 Solve this question :
Ask AI
Q2.1
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?
Ask AI
Q.3 Solve this question :
Ask AI
Q3.1
Describe insertion in max heap tree with example from the following list of numbers: 33, 42, 67, 23, 44, 49, 74
Ask AI
Q.4 Solve this question :
Ask AI
Q4.1
Sort the given values using quicksort and write time complexity of algorithm: 65, 70, 75, 80, 85, 60, 55, 50, 45
Ask AI
Q.5 Solve both questions :
Ask AI
Q5.1
Insert the following sequence of elements into an AVL tree, starting with an empty tree: 10, 20, 15, 25, 30, 16, 18, 19
Ask AI
Q5.2
Delete 30 in the AVL tree that you got.
Ask AI
Q.6 Solve both questions :
Ask AI
Q6.1
Write algorithm for quicksort and mention time and space complexity in each case.
Ask AI
Q6.2
Define collision in hashing. What are the different methodologies to resolve collision? Explain briefly.
Ask AI
Q.7 Solve this question :
Ask AI
Q7.1
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
Ask AI
Q.8 Solve both questions :
Ask AI
Q8.1
Write algorithm to count leaf node in binary tree and check whether tree is balanced or not.
Ask AI
Q8.2
Write a recursive and iterative version of insertion sort algorithm and mention time complexity.
Ask AI
Q.9 Write short notes on the following:
Ask AI
Q9.1
BFS
Ask AI
Q9.2
DFS
Ask AI
Q9.3
Binary search tree
Ask AI
Q9.4
Balance factor
Ask AI
2017051403
B.Tech Examination, 2017
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
Ask AI
Q1
Answer the following:
a)2 marksHow many number of interchanges are required to sort 5, 1, 6 in ascending order using Bubble sort?
b)2 marksWhat is the postfix form of the expression ?
c)2 marksHow many leaf nodes are present in a full binary tree with nodes?
d)2 marksA 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 .............
e)2 marksWhat is LIFO?
f)2 marksWhat are the minimum number of multiplications and additions required to evaluate the given polynomial ?
g)2 marksWhich of the following sorting methods would be most suitable for sorting a list which is almost sorted?
h)2 marksWhat values are automatically assigned to those array elements which are not explicitly initialized?
i)2 marksWhat is the time complexity of Merge sort and Heap sort algorithms?
j)2 marksWhat is complete binary Tree?
Ask AI
Q2
Answer the following:
a)14 marksWhat 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.
Ask AI
Q3
Answer the following:
a)7 marksWhat is an algorithm? What are the characteristics of a good algorithm?
b)7 marksWhat is a sparse matrix? How is it stored in the memory of a computer?
Ask AI
Q4
Answer the following:
a)6 marksDescribe about the doubly linked list with an example. Write the advantages of linked list over array.
b)8 marksShow the various passes of bubble sort on an unsorted list 11, 15, 2, 13, 6
Ask AI
Q5
Answer the following:
a)9 marksDefine a stack. Describe ways to implement stack.
b)5 marksDifferentiate between system defined data types and abstract data types with suitable examples.
Ask AI
Q6
Answer the following:
a)7 marksDescribe insertion sort with a proper algorithm. What is the complexity of insertion sort in worst case?
b)7 marksWrite an algorithm to insert a node in the beginning of the linked list.
Ask AI
Q7
Answer the following:
a)9 marksFor the given Binary Search Tree, perform the following sequence of operations: (A) Delete 44 (B) Delete 75 (C) Delete 25
b)5 marksWrite down the applications of stack and queue data structures.
Ask AI
Q8
Answer the following:
a)8 marksConstruct 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
b)6 marksWhat do you mean by hashing? Explain any three popular hash functions.
Ask AI
Q9
Answer the following:
a)14 marksWrite short notes on following (any two):
Ask AI
2016051403
B.Tech Examination, 2016
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
Ask AI
Q1
Answer the following:
a)2 marksThere are 8, 15, 13 and 14 nodes in four different trees. Which one of them can form a full binary tree?
b)2 marksWhich data structure is used to perform recursion and why?
c)2 marksList out the areas in which data structures are applied extensively.
d)2 marksSorting is not possible by using which of the following methods and why? Insertion, Selection, Exchange, Deletion
e)2 marksWhat is FIFO?
f)2 marksWhat is a postfix expression?
g)2 marksDifferentiate between linear and non-linear data structures.
h)2 marksHow do you insert a new item in a binary search tree?
i)2 marksDifferentiate between stack and array.
j)2 marksWhat is an AVL tree?
Ask AI
Q2
Answer the following:
a)10 marksWrite binary search algorithm and trace to search element 91 in the following list: 13, 30, 62, 73, 81, 88, 91
b)4 marksWhat are the limitations of binary search?
Ask AI
Q3
Answer the following:
a)7 marksDraw 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
b)7 marksWhat is stack? How can stack be used to check whether an expression is correctly parenthesized or not? [Hint: () is correct but (( or )()( is not]
Ask AI
Q4
Answer the following:
a)7 marksConvert the following infix expression into a postfix expression (show steps): $A * (B+D) / E - F(G + H/k)$
b)7 marksHow do you find the complexity of an algorithm? What is the relation between the time and the space complexities of an algorithm?
Ask AI
Q5
Answer the following:
a)14 marksWrite an algorithm to create a singly linked list. Explain the steps to do the following operations:
Ask AI
Q6
Answer the following:
a)8 marksArrange the given list of elements in ascending order using quick sort: 44, 33, 11, 55, 77, 90, 40, 60, 99, 22, 88, 66
b)6 marksDefine an array. How does an array differ from an ordinary variable? How are arrays represented in the memory?
Ask AI
Q7
Answer the following:
a)14 marksDefine hashing. Describe any two commonly used hash functions. Describe one method of collision resolution.
Ask AI
Q8
Answer the following:
a)8 marksWrite down the procedure for inserting and deleting elements from a circular queue implemented using arrays.
b)6 marksWhat is a height balanced tree? Explain how the height is balanced after addition/deletion of nodes in it.
Ask AI
Q9
Answer the following:
a)14 marksWrite short notes on any two the following:
Ask AI
2015051403
B.Tech Examination, 2015
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
Ask AI
Q1
Answer the following:
a)2 marksIf 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
b)2 marksQueue can be used to implement
c)2 marksThe number of binary trees with 3 nodes which when traversed in post-order gives the sequence A, B, C is
d)2 marksA binary tree has leaf nodes. The number of nodes of degree 2 in this tree is
e)2 marksSparse matrices have
f)2 marksThe postfix expression for is
g)2 marksThe memory address of the first element of an array is called
h)2 marksThe memory address of fifth element of an array can be calculated by the formula
i)2 marksWhich of the following data structures are indexed structures?
j)2 marksWhich of the following is not the required condition for binary search algorithm?
Ask AI
Q2
Answer the following:
a)7 marksWhat is a data structure? What is the need of data structures?
b)7 marksExplain Big-Oh notation with the help of example.
Ask AI
Q3
Answer the following:
a)7 marksWrite 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?
b)7 marksWrite a program that sorts a given list of numbers using quicksort.
Ask AI
Q4
Answer the following:
a)7 marksExplain overflow and underflow conditions of a stack with examples.
b)7 marksWhat are priority queues? Write their applications.
Ask AI
Q5
Answer the following:
a)7 marksWrite 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.
b)7 marksExplain the merits and demerits of static and dynamic memory allocation techniques.
Ask AI
Q6
Answer the following:
a)7 marksDefine the following terms: (i) Root (ii) Leaf nodes (iii) Empty tree (iv) Sub-tree
b)7 marksWhat 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?
Ask AI
Q7
Answer the following:
a)7 marksExplain the following graph theory terms: (i) Node (ii) Undirected graph (iii) Edge (iv) Connected graph (v) Directed graph (vi) Disconnected graph
b)7 marksWrite the Warshall's algorithm.
Ask AI
Q8
Answer the following:
a)7 marksWrite an explanatory note on AVL rotations.
b)7 marksWrite an algorithm for inserting a key K in a B-tree.
Ask AI
Q9
Answer the following:
a)7 marksWhat is a sparse matrix? What are the methods to represent a sparse matrix?
b)7 marksUse 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.
Ask AI