Professional Documents
Culture Documents
Dsa Qb Modulewise (1)
Dsa Qb Modulewise (1)
Dsa Qb Modulewise (1)
2) Illustrate how Bubble sort algorithm helps to sort the following list of integers
32,51,27,85,66,23,13,57 Support your answer using Bubble sort algorithm
3) a) For the given string ‘babaabababaa’ search the pattern ‘aaba’using Knuth Morris Pratt or
Secondary pattern matching algorithm. Illustrate the process using Pattern matching table and
Graph.(values may change)
4) Why insertions and deletions of elements are difficult in the middle of arrays. Discuss with
examples
5) Illustrate different ways to represent the elements of 2-D array of size (3*4) in the memory.
6) Design a function in C to read the elements of 4*5 Sparse matrix. Illustrate how to represent the
given sparse matrix using arrays(matrix may change)
8) There is a list of integer elements that are stored as 1D array 11,12,34,45,55,66,89,98 Apply a best
suitable search algorithm to find the element (34).Illustrate the steps of algorithm and reasons for
choosing that particular algorithm(input may change)
11)”Dynamic memory allocation is a required for efficient memory management”. Justify this
statement using dynamic memory management functions in C
i. Read a main String (STR), a Pattern String (PAT) and a Replace String (REP)
ii. Perform Pattern Matching Operation: Find and Replace all occurrences of PAT in STR with REP if
PAT exists in STR.
iii. Report suitable messages in case PAT does not exist in STR
Support the program with functions for each of the above operations. Don't use Built-in functions
MODULE 2
9) Design an algorithm to implement push and pop functions of Stack using arrays with StackFull and
StackEmpty conditions
12)Discuss the three ways to store the strings into the memory and give reason which one is the
best and efficient
14)Write a program to perform push and pop operations in Stacks using dynamic arrays
18) Solve the following infix expression to postfix expression using stack
21) Illustrate IsFull and IsEmpty functions using Stacks with example
22) Implement the recursive function for the following: i). Factorial of a number ii.) Tower of Hanoi
MODULE 3
16)Demonstrate the working of circular queue of integers using array to perform the following
operations: (i) Insert (ii) Delete (iii) Display
MODULE 4
26) Differentiate between singly Linked List and Doubly Linked List.
27) What is linked list? Write the program for create and traverse operations in single linked list with
example.
29) Write the program for create, insertion and traverse operations in doubly linked list with real-
time example
36) Apply the algorithm for create and traverse operations in single linked list with example
MODULE 5
30) Implement recursive function for different traversal techniques of a binary tree with examples.
31) Describe AVL Trees, AVL Rotations and Balance factor with examples.
32) Implement the insertion, deletion and search operations on AVL trees.
37) Apply a recursive Algorithm for pre order traversal, post order traversal and Inorder traversal
with examples
14) b)Create a structure EMPLOYEE that contain the following data members Empid, EmpName,
EmpDept, declare its variables and represent how we can access its data members using variables
6.What is well defined recursive function. Write the recursive function algorithm for
1)factorial 2)fibonnacci series
10.What is Euclidean algorithm to find the GCD. Discuss by taking two numbers .(value of 2 numbers
can also be given)
11.What is queue data structure? Show the represenation of queue into the memory
15.Write an algorithm to convert infix to postfix. solve the following (a*b)+c using above
algorithm(expression can change).