Data Structures Lab using C
Course Code BECL456D
CIE Marks 50
Teaching Hours/Week (L:T:P:S) 0:0:2
SEE Marks 50
Total Hours of Pedagogy 15 Sessions
Total 100
Credits 01
Exam Hours 03
Experiments
1 Write a C Program to create a Student record structure to store, N records, each record having
the structure shown below: USN, Student Name and Semester. Write necessary functions
a. To display all the records in the file. b. To search for a specific record based on the USN. In
case the record is not found, suitable message should be displayed. Both the options in this case
must be demonstrated. (Use pointer to structure for dynamic memory allocation)
2 Write a C Program to construct a stack of integers and to perform the following operations on it:
a. Push b. Pop c. Display The program should print appropriate messages for stack overflow,
stack underflow, and stack empty.
3 Write a C Program to convert and print a given valid parenthesized infix arithmetic expression
to postfix expression. The expression consists of single character operands and the binary
operators + (plus), - (minus), * (multiply) and / (divide).
4 Write a C Program to simulate the working of a queue of integers using an array. Provide the
following operations: a. Insert b. Delete c. Display
5 Write a C Program using dynamic variables and pointers to construct a stack of integers using
singly linked list and to perform the following operations: a. Push b. Pop c. Display The
program should print appropriate messages for stack overflow and stack empty.
6 Write a C Program to support the following operations on a doubly linked list where each node
consists of integers: a. Create a doubly linked list by adding each node at the front. b. Insert a
new node to the left of the node whose key value is read as an input c. Delete the node of a
given data, if it is found, otherwise display appropriate message. d. Display the contents of the
list. (Note: Only either (a,b and d) or (a, c and d) may be asked in the examination)
7 Write a C Program a. To construct a binary search tree of integers. b. To traverse the tree using
all the methods i.e., inorder, preorder and postorder. c. To display the elements in the tree.
8 Write recursive C Programs for a. Searching an element on a given list of integers using the
Binary Search method. b. Solving the Towers of Hanoi problem.
9 Write a program to traverse a graph using BFS method.
Write a program to check whether given graph is connected or not using DFS method.
10 Design and develop a program in C that uses Hash Function H:K->L as H(K)=K mod
m(reminder method) and implement hashing technique to map a given key K to the address
space L. Resolve the collision (if any) using linear probing
Note: The students must be encouraged to create Leetcode account and work on Leetcode platform to
improve the competency.
Suggested Learning Resources:
Textbooks:
• Data Structures using C, Reema Thareja, 2nd Edition, Oxford University Press, 2011
• Introduction to the Design and Analysis of Algorithms, Anany Levitin: 2nd Edition, 2009.Pearson.
• Online Courses:
o Coursera: "Algorithms" by Princeton University (taught by Robert Sedgewick and Kevin Wayne).
o edX: "Algorithmic Design and Techniques" (offered by UC San Diego and Higher School of Economics).
• Websites and Online Resources:
o Geeks for Geeks: Offers a wide range of tutorials, practice problems, and coding challenges related to
data structures and algorithms.
o Leet Code: Provides coding challenges that are frequently asked in technical interviews and cover a
variety of algorithmic concepts.
o Hacker Rank: Offers coding challenges and competitions with a focus on algorithms and data structures.
o Top Coder: Provides algorithmic challenges and competitions for practicing and improving problemsolving skills.
• YouTube Channels:
o My code school: Offers video tutorials on various data structures and algorithms topics.
o The Coding Train: Provides interactive coding tutorials on algorithms and data structures.
• Coding Platforms:
o Code forces: Offers competitive programming challenges to improve algorithmic problem-solving skills.
Hackerearth: Provides coding competitions and challenges along with tutorials and practice problems
0 Comments