0% found this document useful (0 votes)
4 views

Module 1 2 QB

Uploaded by

Mystichtechboy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Module 1 2 QB

Uploaded by

Mystichtechboy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Question Bank

Module 1

1. Define Data Structures. Explain the types of structures with examples for each. What
are the primitive operations that can be performed?
2. Differentiate between Structures and Unions with examples.
3. What do you mean by Pattern Matching? Outline Knuth, Morris, Pratt pattern matching
algorithm. Implement KMP algorithm to find the occurrence of the following pattern P
in the main string S.

(1) S: B A C B A B A B A B A C A C A
P: A B A B A C A
(2) S: A B C X A B C D A B X A B C D A B C Y
P: A B C D A B C Y
4. Define Stack. Give the implementation of push(), pop() and Display() functions by
considering its empty and full conditions.
5. Write an algorithm to convert Infix Expression to Postfix Expression and apply the
same for the given postfix expression
(a). 6,2,/,3,-,4,2,*,+
(b). ((H * ((((A + ((B + C) * D)) * F) * G) *E)) +J)
6. Write the postfix form of the following expression using stack.
(a) A*(B*C+D*E)+F
(b) (a+(b*c)/(d-e))
(c) (a+b)*d+e/(f+a*d)+c
(d) ((a/(b-c+d))*(e-a)*c)
7. Explain the following dynamic memory allocation functions along with syntax and
example:
(a)Malloc (b) Calloc (c) realloc (d) free
8. Define polynomial. Explain with example how A(x)=3x23+3x4+4x2+15 and
B(x)=x5+20x3+2, are stored in a 1-D array.
9. Define sparse matrix. Express the following matrix in triplet form and find its transpose.

Module 2

1. Write a C program to perform insertion, deletion and display operation on queue.


2. Discuss how binary tree are represented using
(a)Array (b) Linked list
3. What are the disadvantages of ordinary queue? Discuss the implementation of Circular
Queue.
4. Define queue. Discuss how to represent queue using dynamic arrays.
5. Write a note on multiple stacks and priority queue.
6. Discuss inorder, preorder, postorder and level order traversal with suitable recursive
function for each.
7. Define Threaded Binary Tree. Discuss In-Threaded binary tree.
8. What is a tree? With suitable example explain
(a)Binary tree (b) Complete binary tree
(c) Strictly binary tree (d) Skewed binary tree
9. Consider the following tree T given below. Write the preorder, inorder and postorder
traversals for the tree T. Also find the depth of tree T.

10. Draw a Binary tree for the following expression: ((6+(3-2)*5)^2+3.


Traverse the above generated tree using Pre-order, In-order and Post-order traversals
11. Given the following traversal. Draw a binary tree
(a) Inorder: 4 2 5 1 6 7 3 8
Postorder: 4 5 2 6 7 8 3 1
(b) Preorder: A B C E I F J D G H K L
Inorder: E I C F J B G D K H L A
12. Define threaded binary tree. List its advantages and disadvantages. Draw the one way
threading and two way threading of the following binary tree.

You might also like