ADSA Assi
ADSA Assi
(Section-30)
Note: Handwritten assignment to be submitted.
Issued on: 26-Nov-2024
Deadline: 01-Dec-2024
1. Define algorithmic complexity and explain its significance. Compare time and space
complexity with examples.
2. Explain Big O, Omega, and Theta notations with examples.
3. Analyze the time complexity of the following pseudocode.
4. Solve and analyze the time complexity of a binary search algorithm for an array of
size n=16n = 16n=16.
Arrays
Linked Lists
1. Describe the implementation of a singly linked list and write an algorithm for
insertion at the beginning.
2. Compare singly, doubly, and circular linked lists in terms of memory usage and
operations.
3. Write a program to delete a specific node from a circular linked list and analyze its
time complexity.
4. Explain the traversal operation in a doubly linked list and its applications.
5. Write a function to merge two sorted linked lists into a single sorted linked list.
6. Implement a program to remove duplicate nodes from an unsorted linked list.
7. Write a program to implement a queue using a singly linked list.
8. How would you implement a stack using a singly linked list? Write the code for push
and pop operations.
9. Explain and implement a function to check whether two singly linked lists intersect at
any point.
Stacks
1. Explain how a stack can be implemented using a linked list and write the algorithm
for the "push" operation.
2. Convert the infix expression (A+B)∗ (C−D)/(A+B) to postfix using a stack and write
the algorithm.
3. Evaluate the postfix expression 62/3+5∗ 8−6 /2 using a stack and explain the process
and write the algorithm.
4. Discuss the role of stacks in recursion and their use in function call management.
Recursion
Queues
1. What are the advantages of using a circular queue over a simple queue?
2. Explain the implementation of a queue using a linked list, including enqueue and
dequeue operations.
3. Discuss the concept of a priority queue and describe its implementation using a heap.
4. Write an algorithm to implement a circular queue and explain its advantages over a
regular queue.
5. Design a linked list-based implementation of a queue.
6. Write a function to reverse the elements of a queue using recursion.
7. Implement a circular queue and demonstrate enqueue and dequeue operations.
8. Write a program to simulate a printing queue where jobs are processed in the order
they are received.
9. Describe the concept of a double-ended queue (Deque). Give an example where a
deque can be useful.
Hashing
1. Explain the concept of hashing and collision resolution techniques, such as chaining
and linear probing, with examples.
2. Insert the keys [23,43,13,27][23, 43, 13, 27][23,43,13,27] into a hash table of size 10
using the hash function h(x)=x%10h(x) = x \% 10h(x)=x%10 and chaining.
Trees
Insert the value 60 and 75 into the tree and show the new tree structure.
8. Given the following Binary Search Tree, delete the node with value 30 and then 70: