Data structures and Algorithm
1. Define data structures. With a neat diagram, explain the classification of data structures with
examples.
2. What do you mean by pattern matching? Outline the Knuth Morris Pratt (KMP) algorithm and
illustrate it to find the occurrences of the following pattern. P: ABCDABD S: ABC ABCDAB
ABCDABCDABDE .
3. Write a program in C to implement push, pop and display operations for stacks using arrays.
4. Explain in brief the different functions of dynamic memory allocation.
5. Write functions in C for the following operations without using built-in functions i) Compare two
strings. ii) Concatenate two strings. iii) Reverse a string
6. Write a function to evaluate the postfix expression. Illustrate the same for the given postfix
expression: ABC-D*+E$F+ and assume A=6, B=3, C=2, D=5, E=1 and F=7.
7. Define data structure. List & explain data structure operations.
8. Explain Dynamic memory Allocation functions with examples.
9. Define stack. Implement push and pop operations for stack using arrays.
10. Write a C function to convert infix to a postfix expression. Convert the given expression: A $ B *
C – D + E / F / (G + H).
11. Define data structures. Explain with neat block schematic different types of data structures with
examples. What are the primitive operations that can be performed?
12. Define sparse matrix. Express the following matrix in triplet form and find its transpose.
a. A
13. Explain any four dynamic memory allocation functions with syntax and example.
14. What do you mean by pattern matching? Outline the KMP algorithm. Implement the same to
find out the occurrence of following pattern. P:ABCDABD S:ABC ABCDAB ABCDABCDABDE