Data Structure Using C Laboratory Manual
Data Structure Using C Laboratory Manual
Laboratory Manual
Rules:
1. The above mentioned 10 laboratories must be completed in a semester.
2. Each laboratory must be completed in two labs (One practice lab followed by an
evaluation lab). In practice lab the lab assistants, faculty will assist the student whereas in
evaluation lab no assistance from any of the staffs will be entertained.
3. Each laboratory carries 100 marks.
a. Attending practice lab……………….20 Marks Continuous Evaluation
b. Record………………………………..20 Marks
c. Evaluation Lab……………………….30 Marks
d. Lab Test..……………………………..30 Marks
One-time Evaluation at
i. Programming Ability Test……20 Marks
the end of 10 laboratories
ii. Viva/Quiz Test………………...10 Marks
4. All practice lab and evaluation lab questions will be asked from the lab manual.
5. Absenteeism in any lab means corresponding marks will be deducted.
6. Discipline has the highest priority.
Sample Output
5. Inversion Count for an array indicates – how far (or close) the array is from being sorted.
If array is already sorted then inversion count is 0. If array is sorted in reverse order that
inversion count is the maximum. Formally speaking, two elements a[i] and a[j] form an
inversion if a[i] > a[j] and i < j. Write a program to count inversions in an array.
Sample Input
2 3 8 6 1
Sample Output
Explanation
Case 2: The inversions are (2, 1), (3, 1), (8, 6), (8, 1), (6, 1)
2. Implement a stack of characters and create mystack.h. Write a program to check whether
an entered string is a palindrome or not. Include mystack.h for doing this.
4. Including mystack.h write a program to convert an infix expression into its equivalent
postfix expression.
2. Write a program to implement single threaded binary tree and perform the following functions.
a. Inserting a key
b. Deletion of a key
c. In-order traversal using the thread
d. Maximum depth of the tree
3. Write a program to check whether the given binary tree is heap or not.
4. Write a program to implement ternary search tree.
5. Write a function to check whether all the leaves of a AVL-tree are at same level or not.
6. Write a function to print all nodes at distance k from the leaf in an AVL tree.