Professional Documents
Culture Documents
DS Lab Manual 2022
DS Lab Manual 2022
UNIVERSITY
DEPARTMENT OF
COMPUTER SCIENCE &
ENGINEERING
SCHOOL OF ENGINEERING
Course Code:
USN:
Name:
Semester:
Section:
CERTIFICATE
Signature of Examiner
1
INDEX
6 Lab Experiment 3
7 Lab Experiment 4
8 Lab Experiment 5
9 Lab Experiment 6
10 Lab Experiment 7
11 Lab Experiment 8
12 Lab Experiment 9
13 Lab Experiment 10
14 Lab Experiment 11
15 Lab Experiment 12
16 Lab Experiment 13
17 Lab Experiment 14
18 Lab Experiment 15
19 Lab Experiment 16
20 Lab Experiment 17
2
LAB OBJECTIVES
Upon successful completion of this Lab the student will be able to:
● To Implement Linked Lists and variations and use them to store data.
3
INTRODUCTION ABOUT LAB
RAM : 8GB
Software
All systems are configured in DUAL BOOT mode i.e., Students can boot from
Windows 8 or Linux as per their lab requirement. This is very useful for students
because they are familiar with different Operating Systems so that they can execute
their programs in different programming environments.
This is very useful because students can save it in their own accounts. Each
student's work is safe and secure from other students.
Latest Technology like J2EE, is installed in some systems. Before submitting their
final project, they can start doing mini projects from 2nd year onwards.
Systems are assigned numbers and the same system is allotted for students when
they work in the lab.
4
GUIDELINES TO STUDENTS
● Equipment in the lab for the use of the student community. Students need to
maintain a proper decorum in the computer lab. Students must use the
equipment with care. Any damage caused is punishable.
● Students are required to carry their observation / programs book with completed
exercises while entering the lab.
● Students are supposed to occupy the machines allotted to them and are not
supposed to talk or make noise in the lab. The allocation is put up on the lab
notice board.
● Lab records need to be submitted on or before the date of submission.
● Do not touch, connect or disconnect any plug or cable without
● your lecturer/laboratory technician’s permission
● Read and understand how to carry out an activity thoroughly before
coming to the laboratory.
● Do not carry eatables to the laboratory.
● Program coding and compilation instructions: Open Terminal and type the
following in shell command line:
○ To Type your program: gedit filename.c
○ To Compile your program: gcc filename.c
○ To Execute : ./a.out
5
LIST OF LAB EXERCISES
1.Write a program to add, subtract, multiply and divide two integers using user defined type
function with return type.
2. Write a program to find the sum of digits of the number and print the reverse of that
number using Recursive Function.
4. A structure stores the x & y coordinates of a point on the screen, a rectangle structure
stores the coordinates of the upper left & the lower right points corners of a rectangle. Write
a function that accepts rectangle structure r as an argument and computes the area of r.
5. Design, Develop and Implement a menu driven Program in C for the Searching Techniques
on arrays i.e, 1. Linear search 2. Binary search. If unsorted array is given as input, your
program must perform sorting (bubble sort) to use it as input for binary search algorithm.
6. Write a C program for array representation of Stack /Queue with basic functions.
11. Write a C program to perform the following operations on Circular QUEUE of Characters
a. Insert b.Delete c. Demonstrate Overflow and Underflow situations.
12. Implement the following operations (Demonstration of stack and Queues) on Singly
Linked List (SLL)/ Doubly Linked List (DLL) of Student Data with the fields: RollNo, Name,
Semester a. Create a SLL of N Students Data by using front insertion. b. Display the count
of nodes in it c. Perform Insertion / Deletion at End of SLL d. Perform Insertion / Deletion at
Front of SLL .
14. Implement a menu driven Program in C for the following operations on Binary Search
Tree (BST) of Integers 6, 9, 5, 2, 8, 15, 24, 14, 7, 8, 5, 2 as input. a. Create a BST of N Integers
b. Traverse the BST in In-order, Pre-order and Post-order c. Search the BST for a given
element (KEY) and report the parent.
15. Implement Program to create a binary expression tree given string of postfix expression
as input and perform In-order, Pre-order and Post-order traversal.
16. Implement a Program in C for the following operations on Graph(G) of Cities a. Create a
Graph of N cities using Adjacency Matrix. b. Print all the nodes reachable from a given
starting node in a digraph using DFS/BFS method.
17. Write a C program to implement File operations a. Open a file b. Write c. Read d. close
6