The vertex, removal of which makes a graph disconnected is called
Official theoretical question paper for Data Structure Algorithms (PCC-CS301) conducted by Maulana Abul Kalam Azad University of Technology. All questions from Groups A, B, and C are reproduced below with marks weightings.
The vertex, removal of which makes a graph disconnected is called
Stability of Sorting Algorithm is important for
A vertex of in-degree zero in a directed graph is called
The ratio of items present in the hash table, to the total table size is called
The Ackerman function, for all non-negative values of m and n is recursively defined as $$ A(m, n) = \begin{cases} n + 1 & \text{if } m = 0 \\ A(m - 1, 1) & \text{if } m \ne 0 \text{ but } n = 0 \\ A(m - 1, A(m, n - 1)) & \text{if } m \ne 0 \text{ and } n \ne 0 \end{cases} $$ Therefore the value of A(1, 2) is:
If a binary tree is threaded for in-order traversal a right NULL link of any node is replaced by the address of its
In a height balanced tree the heights of two sub-trees of every node never differ by more than
Adjacency matrix of a digraph is
Which of the following is the best time for an algorithm?
A linear list in which elements can be added or removed at either end but not in the middle is known as
Show that the function f(n) defined by: $$ \begin{aligned} &f(1) = 1 \\ &f(n) = f(n-1) + \frac{1}{n} \quad \text{for } n > 1 \end{aligned} $$ has the complexity O(log n). Define Big-O, Ω, θ notations.
Let the size of the elements stored in an 8 × 3 matrix be 4 bytes each. If the base address of the matrix is 3500, then find the address of A[4, 2], for both row major & column major cases. What is sparse matrix?
Write an algorithm to insert a node in a BST.
Write an algorithm to solve the Tower of Hanoi problem. Also calculate the time complexity of your algorithm.
Prove that, for any non-empty binary tree T, if n₀ be the number of leaves and n₁ be the number of nodes of degree 2, then n₀ = n₁ + 1.
a) Write an algorithm of Merge Sort and explain with an example. b) Compare the complexity of selection sort & insertion sort. c) Explain with a suitable example, the principal operation of Quick sort. d) Find the complexity of Quick sort algorithm.
a) Write an algorithm to add two polynomials. b) Write the recursive function for the Tower of Hanoi problem. Also draw the recursion tree for any set of initial values. c) What is hashing? Explain Linear Probing & Quadratic Probing with example. d) Derive values related to the average case and worst case behavior of Bubble Sort algorithm. Also, confirm that the best case behavior is O(n).
a) The in-order & pre-order traversal sequence of nodes in a binary tree are given below: In-order: E A C K F H D B G Pre-order: F A E K C D H G B Draw the binary tree. State briefly the logic used to construct the tree. b) Insert the following keys into a B-Tree of order 3: p, q, r, d, h, m, l, s, k, n. c) Construct an expression tree for the expression E = (2x + y) * (5a - b)³. d) Write a non-recursive algorithm for in-order traversal of a binary tree.
a) Write the difference between stack and queue and implement the operations of priority queue. b) Explain spanning tree and create a spanning from the following graph.  c) Write the key features of circular linked list and state why it is important in case of Josephus problem.
a) How can a polynomial such as 5x⁴ - 3x² + 9x - 11 be represented by a linked list? b) Explain the advantages of binary search over sequential search. c) Write an algorithm to delete a node from a doubly linked list, where a node contains one data and two address (prev & next) portion. d) Are recursive routines more efficient than non-recursive routines? Justify your answer with example.