Data Structures and Algorithms
Community
Data Structures and Algorithms
2081 Boards
Section A
Answer any two questions.
1
Define circular queue. How queue differ from stack. Write a program to implement linear queue.
10
Connect with us on Discord to become a contributor.
2
What is AVL tree? How heap differ from tree? Construct an AVL tree for data 24,12,8,15,35,30,57,40,45 and 78.
10
Connect with us on Discord to become a contributor.
3
Define list. How can you use linked list to implement stack? Explain circular linked list.
10
Connect with us on Discord to become a contributor.
Section B
Answer any eight questions.
4
Explain Big O notation in brief. Find Big O of the following function:
f(x) = 5x4+ 9x2 + 7x + 9.
5
Big O notation describes the upper bound of the growth rate of a function. It characterizes the asymptotic behavior of a function (e.g., algorithm's running time or space complexity) as the input size approaches infinity, ignoring constant factors and lower-order terms.
For the function f(x) = 5x⁴ + 9x² + 7x + 9:
- Identify the highest power term: The terms are 5x⁴, 9x², 7x, and 9. The term with the highest power of x is 5x⁴.
- Drop constant coefficients: The constant coefficient for the highest power term (5x⁴) is 5. Big O notation ignores constant factors.
- Drop lower-order terms: The terms 9x², 7x, and 9 are lower-order terms compared to x⁴. Big O notation focuses on the dominant term for large input sizes.
Therefore, the Big O notation for f(x) = 5x⁴ + 9x² + 7x + 9 is O(x⁴).
5
Convert the infix expression
A+(((B-C)*(D-E)+F)/G)$(H-I) into post expression using stack.
5
Connect with us on Discord to become a contributor.
6
Write a program to find GCD of two numbers using recursion.
5
Connect with us on Discord to become a contributor.
7
What is the application of spanning tree? Draw a MST of a graph containing any 8 vertices and 11 edges with arbitrary edge costs.
5
Connect with us on Discord to become a contributor.
8
Sort the number {82, 73, 12, 39, 26, 88, 2, 9, 60, 41} using shell sort.
5
Connect with us on Discord to become a contributor.
9
What is hashing? how do you apply linear probing and rehashing explain with example.
5
Connect with us on Discord to become a contributor.
10
What is the algorithm for node insertion and deletion from specified position from doubly linked list.
5
Connect with us on Discord to become a contributor.
11
What is linear queue? Why do we need circular queue? Explain.
5
Connect with us on Discord to become a contributor.
12
Write short notes on:
Breadth First traversal of graph
TOH
5
Connect with us on Discord to become a contributor.