Lab Manual (DS)
Lab Manual (DS)
LAB MANUAL
1
Learning Objective:
To provide the knowledge of basic data structures and their implementations.
To understand concepts about searching and sorting techniques
To Understand basic concepts about stacks, queues, lists trees and graphs
To understanding about writing algorithms and step by step approach in solving
problems with the help of fundamental data structures
To develop skills to apply appropriate data structures in problem solving.
2
LAB-205 : DATA STRUCTURE USING C
(BCA-II Semester)
WAP to input the elements of array and display it.
WAP to input the elements of array and calculate its sum and average.
WAP to input the location and element to replace the existing number.
WAP to show the continuous memory allocation of the elements of array.
WAP to sort the elements of array by using bubble sort.
WAP to sort the elements of array by using selection sort.
Write an algorithm to sort the elements of an array by using radix sort.
WAP to implement insertion sort.
WAP to calculate the physical address of nth element of the array.
WAP to implement linear search.
WAP to implement binary search.
Write the difference between linear and binary search.
WAP to implementation of 2-dimensional array.
WAP to input a matrix of order 3X3 and find its transpose.
WAP to input a matrix of order 3X3 and check it is symmetric or not.
WAP to input a matrix of order 3X3 and check it is sparse or not.
WAP to input a matrix of order 3X3 and display its principal diagonal and its reverse
diagonal.
WAP to input a string:-(Without using pre-defined function)
a) Find its length
b) Reverse the string
c) Display the ASCII value of each character
WAP to input a Paragraph:-
a) Count total number of words
3
b) Count total number of sentences
WAP to input a mobile number and check it is valid or not.
WAP to implement the following programs by using recursion:-
a) GCD of three numbers
b) Fibonacci Series
c) Permutation and Combination
WAP to implement Stack and perform different operations like push, pop and peep on
it.
WAP to implement Queue and perform insertion, deletion and traversal.
WAP to implement input restricted queue and perform different operations.
WAP to implement output restricted queue and perform different operations.
WAP to implement Circular queue and perform different operations.
WAP for the traversal of tree(Recursive Function):
a) Pre-Order b) Post-Order c) In-Order
Construct a binary tree and discuss the different terminology related to it.
Write the difference between binary tree, restricted binary tree and complete binary
tree.
Construct a binary tree :-
(a) In-Order: D B E A F C
Pre-Order: A B D E C F
(b) In-Order: 4 8 2 5 1 6 3 7
Post-Order: 8 4 5 2 6 7 3 1
Construct a Binary Search Tree:-
(a) 100, 20, 10, 30, 200, 150, 300, 90, 85
(b) Sunday Monday Tuesday Wednesday Thursday Friday Saturday
4
Construct a binary search tree and perform insertion and deletion of the node.
Write about AVL tree and explain about different rotation methods to balance the tree.
WAP to implement singly link list.
WAP to implement doubly link list.
WAP to implement circular link list.
Write and explain different types of Graph with suitable example.
Construct adjacency matrix and adjacency list of the following graph:
V1 V2
V3
V4 V5
A B
C D