Professional Documents
Culture Documents
Dsa Coxco-qb
Dsa Coxco-qb
Illustrate Pseudocode.
Define ADT.
Give two examples of algorithms requiring Best, Worst and Average case analysis
Write a recursive algorithm to find the number of bits in the binary representation of a number n.
Is it advisable to measure the running time of an algorithm in terms of time units? Justify
Compare the growth rates of the functions log n and n^2 using L'Hopital's rule
Identify the input size metric and basic operation count for Sorting algorithms.
Determine the efficiency class for the matrix addition algorithm and justify.
Best Case analysis is more useful than Worst case analysis. True / False. Justify
Classify data structures. Elaborate on various types of linear data structures and state two applications for each.
Order the following functions in increasing order of growth and give the tight upper bound for each functio
f1(n)=n^3, f2(n)=nlog2n, f3(n)=log4n, f4(n)=n, f5(n)=n^2, f6(n)=√n, f7(n)=22n
Write an algorithm to check if a matrix is symmetric and determine its efficiency class.
Write the algorithm for finding all prime numbers untill a given number and illustrate its working.
Describe how the L'Hopital's rule can be used to compare the growth rates of functions with examples.
Identify the suitable data structure for each of the following scenarios and justify:
a. Railway reservation system b. Social network representation c. Reverse a string d. File directory
Outline various efficiency classes and state a possible scenario for each class.
Prove that if If t1(n) Î O(g1(n)) and t2(n) Î O(g2(n)) then t1(n) + t2(n) Î O(max{g1(n), g2(n)}).
Illustrate various algorithms to find GCD of two numbers and also find GCD (128, 14).
Describe Asymptotic notations used in algorithm analysis with necessary graphs and examples.
Write down the sequential search algorithm and analyze its worst-case, best-case and average-case efficiencies.
Write the condition for empty list in the case of: a. Singly Linked List b. Circularly linked list
Give the time complexity of search and traversal operations in a Singly Linked List.
Write an algorithm to insert an element into the beginning of a Circularly Linked List.
Apply radix sort on the following set of numbers: 46, 89, 23, 72, 11, 90, 13
The access time for any element in a single dimensional array is O(1). Justify.
Frame an addressing function to access the element at position [i, j] of a two dimensional array stored in row-major
order.
Given two singly linked lists, construct the resultant linked list formed by performing union operation.
Write algorithms for insert and delete operations on Array based list and explain with examples.
Elucidate on all possibilities of inserting and deleting an element into a sorted Singly linked list with example and
algorithms.
Differentiate between singly linked list and circularly linked list. Devise algorithms for search and delete operations i
a Circularly Linked List.
Illustrate the usage of linked lists for representing polynomials. Also explain the addition of polynomials with exampl
and algorithm.
Write an algorithm for inserting an element in a list using static memory allocation.
Devise algorithms for insertion of a node in a Circularly Linked List at different position.
Write algorithms for deleting an element from doubly linked list and explain with examples.
Write an algorithm to print the values stored in each node of a Doubly linked list in reverse order.
Show how to Swap two values in a singly linked list by adjusting the pointer without using temporary variables.
Write an algorithm to insert a value into a Stack whose size is initially not known.
Show the result of the following sequence of operations on a Array based Stack. Push A, Push B, Pop B, Push C.
Write algorithms to implement Stack ADT using linked list to perform 1.Push 2. Pop 3. Display operations. Show th
result of the following operations on a linked-list Stack: Push 11, 22, 33, and 44. DisplayTop element. Pop once.
Display the Top element.
Write the algorithm for converting an infix expression into postfix form and apply the algorithm to convert the
following expressions:
i)x + y – a * (b + d *( c / e ^ p - q)-s) *+z ii) 3*2(4+5+7)/9
Write algorithms to implement stack of size N using an array. The elements in the stack are to be integers. The
operations to be supported are PUSH, POP and DISPLAY. Take into account the exceptions of stack overflow and stac
underflow.
Develop an algorithm to check whether an expression has balanced parenthesis using Stack. Illustrate the working of
the algorithm for the following input: { [ ( ) ] } }
Outline the algorithm for evaluating a postfix expression using stack with an example.
Write a recursive procedure for Factorial calculation and illustrate the usage of Stack in the function call and return
mechanism.
Mark
2
8
8
15
15
15
15
15
15
15
15
15
15
8