Data Structures Using C
Module 1
1. Demonstrate the address calculation sort for the following no’s: 23, 54, 43, 25, 02, 26,
31, 15, 03, 08, 31, 21.
2. Demonstrate the radix sort for the following no’s: 300, 701, 17, 18, 140, 53, 55, 74, 82,
80, 100.
3. Differentiate between malloc and calloc.
4. Differentiate between Structure, Self-referential structures and Unions.
5. Illustrate the Knuth-Morris-Pratt Algorithm for the given text and pattern using LPS
table.
Text: ABC ABCDAB ABCDABCABDE
Pattern: ABCAB
6. Use the given two-dimensional matrix having m rows and n columns. Represent and
describe the two- dimensional matrix as sparse matrix using arrays.
7. Demonstrate multidimensional array with the help of C code.
8. Write a C program to demonstrate the memory leaks when pointers are not used
properly.
9. Write a C program to swap two numbers using the pointers concept.
10. Write a C program to demonstrate the operations on strings – by writing user-defined
string functions.
11. Explain the dynamic memory management with necessary methods.
12. Outline insertion sort? Explain the procedure for insertion sort. Sort
20,35,40,100,3,10,15 using insertion.
Module 2:
1. Define the concept of Stack and List out the different operations
performed on Stack.
2. Discuss the key difference between Stack and Queue with the help of case study.
3. With the help of C Code, Demonstrate the implementation of Stack using array and
Linked List.
, 4. What do you understand about the terms “Polish notation” and “Postfix Expression” ?
5. Convert the following expression :
● (A + B) * C – (D – E) ^ (F + G) to equivalent postfix notation.
● Convert the infix expression to prefix : ((A + B) * C – (D – E)).
● What is the result of evaluating the postfix expression AB-CD*/ given A= 2 , B = 10 ,
C=4 , D=1.
● Convert the infix expression (A + B) * (D + E + F)/(D*A) to prefix notation.Also
demonstrate with the help of stack contents.
6. What do you understand by the term “Recursion”? Demonstrate the concept of
recursive function in short with the help of
● Factorial
● Fibonacci Series
● Tower of Hanoi
7. With the help of C Code, Demonstrate the concept of representation of a queue with
the help of array and linked list.
8. Differentiate between Circular queue and Priority Queue. List the application of these
mentioned queue concepts.
9. Show the stack after each operation of the following sequence that starts with the
push(5), push(3), pop(), push(2), push(8), pop(), pop(), push(9), push(1), pop(),
push(7), push(6), pop(), pop(), push(4), pop(), pop().
10. In the Towers of Hanoi puzzle, we are given a platform with three pegs, a, b and c.
One peg, a, has a stack of n disks, each larger than the next, so that the smallest is on
the top and the largest is on the bottom. The puzzle is to move all the disks from
peg a to peg c, moving one disk at a time, so that we never place a larger disk on top
of a smaller one. Describe a recursive algorithm for solving the Towers of Hanoi
problem for arbitrary n.
Module 3:
1. What is a SLL? Write a program to implement stack as a singly linked list.
2. Write a program to find for a particular node (based either on the position or on info
of the node ) in a SLL.
Module 1
1. Demonstrate the address calculation sort for the following no’s: 23, 54, 43, 25, 02, 26,
31, 15, 03, 08, 31, 21.
2. Demonstrate the radix sort for the following no’s: 300, 701, 17, 18, 140, 53, 55, 74, 82,
80, 100.
3. Differentiate between malloc and calloc.
4. Differentiate between Structure, Self-referential structures and Unions.
5. Illustrate the Knuth-Morris-Pratt Algorithm for the given text and pattern using LPS
table.
Text: ABC ABCDAB ABCDABCABDE
Pattern: ABCAB
6. Use the given two-dimensional matrix having m rows and n columns. Represent and
describe the two- dimensional matrix as sparse matrix using arrays.
7. Demonstrate multidimensional array with the help of C code.
8. Write a C program to demonstrate the memory leaks when pointers are not used
properly.
9. Write a C program to swap two numbers using the pointers concept.
10. Write a C program to demonstrate the operations on strings – by writing user-defined
string functions.
11. Explain the dynamic memory management with necessary methods.
12. Outline insertion sort? Explain the procedure for insertion sort. Sort
20,35,40,100,3,10,15 using insertion.
Module 2:
1. Define the concept of Stack and List out the different operations
performed on Stack.
2. Discuss the key difference between Stack and Queue with the help of case study.
3. With the help of C Code, Demonstrate the implementation of Stack using array and
Linked List.
, 4. What do you understand about the terms “Polish notation” and “Postfix Expression” ?
5. Convert the following expression :
● (A + B) * C – (D – E) ^ (F + G) to equivalent postfix notation.
● Convert the infix expression to prefix : ((A + B) * C – (D – E)).
● What is the result of evaluating the postfix expression AB-CD*/ given A= 2 , B = 10 ,
C=4 , D=1.
● Convert the infix expression (A + B) * (D + E + F)/(D*A) to prefix notation.Also
demonstrate with the help of stack contents.
6. What do you understand by the term “Recursion”? Demonstrate the concept of
recursive function in short with the help of
● Factorial
● Fibonacci Series
● Tower of Hanoi
7. With the help of C Code, Demonstrate the concept of representation of a queue with
the help of array and linked list.
8. Differentiate between Circular queue and Priority Queue. List the application of these
mentioned queue concepts.
9. Show the stack after each operation of the following sequence that starts with the
push(5), push(3), pop(), push(2), push(8), pop(), pop(), push(9), push(1), pop(),
push(7), push(6), pop(), pop(), push(4), pop(), pop().
10. In the Towers of Hanoi puzzle, we are given a platform with three pegs, a, b and c.
One peg, a, has a stack of n disks, each larger than the next, so that the smallest is on
the top and the largest is on the bottom. The puzzle is to move all the disks from
peg a to peg c, moving one disk at a time, so that we never place a larger disk on top
of a smaller one. Describe a recursive algorithm for solving the Towers of Hanoi
problem for arbitrary n.
Module 3:
1. What is a SLL? Write a program to implement stack as a singly linked list.
2. Write a program to find for a particular node (based either on the position or on info
of the node ) in a SLL.