USICT MCA(SE) Batch: 2023-25
This repository contains source code of DSA (Professor Dr. Reena Gupta) lab programs for USICT MCA(SE) Batch 2023-25.
This section is a walkthrough to setup minimum requirements to run the programs in this repo.
Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals. To check if you have git installed, run the following command in terminal:
git --version
If you do not have git installed, download and install it from here or follow this documentation.
C is a compiled language meaning the source code must be compiled before it can be run.
To check if you have a compiler, run the following command in terminal:
gcc --version
If you do not have a compiler, follow these steps:
-
Firstly, install MSYS2. It will provide the latest builds for mingw-64.
-
Run the installer and follow the steps of the installation wizard.
-
Run these commands in the newly opened MSYS2 shell:
gcc
i.e GNU Compiler Collection contains compiler for many languages such as C, C++, Ada, Go etc. as well as libraries for these languages.
pacman -S mingw-w64-x86_64-gcc
gdb
i.e GNU Debugger is a portable debugger which, ofcourse, helps in debugging your code.
pacman -S mingw-w64-x86_64-gdb
-
Almost done... don't forget to add the mingw bin folder as an environment variable. In most cases it will be
c:\msys64\mingw64\bin
. -
Finally, confirm that everything is working properly by running
gcc --version
.
The easiest step ever. Just run this command on terminal and you are ready to go:
git clone https://github.com/vinayak-vohra/dsa-programs.git
To compile hello-world.c
, use the following command:
gcc hello-world.c -o hello-world
Let's quickly understand what is happening here:
gcc
: Compiler command.hello-world.c
: The file to be compiled.-o hello-world
: Output file name (default:a.out
). see all flags
If there are errors, they will be listed in the terminal. Debug the errors.
If there are no errors in your code, then an executable .exe
file will be generated by the name you provided or by a.out
if you were lazy to do so and the control will return to terminal.
-
If there are some errors, then debug the errors before compiling again because sadly errors don't vanish by themselves.
-
Open a new terminal window (that much you should know how to do), and type the output executable file name. If on bash, add
./
before file name.
Make sure you are in the same folder where file is present.
- Voila~ enjoy the output of your efforts.
-
Implement operations on an
array
:- Traverse
- Insert
- Delete
- Linear search
- Selection sort
-
Implement operations on a linked list and circular linked list:
- Insertion & Deletion
- at the beginning
- at the specified location
- at the end
- Insertion & Deletion
-
Implement operations on a double linked list and circular double linked list:
- Insertion & Deletion
- at the beginning
- at the specified location
- at the end
- Insertion & Deletion
-
Write a program to
count
the number of nodes &reverse
the single linked list. -
Implement operations
push
andpop
on a stack using arrays. Check the status of the stack whether there is underflow or overflow. -
Implement the
conversion
of infix notation to postfix notation -
Implement
evaluation
of postfix notation usingstacks
. -
Implement operations
enqueue
anddequeue
on a queue using arrays. Check the status of the queue whether it is empty or full. -
Implement a
circular queue
using arrays and linked list. -
Implement
stacks
andqueues
using a linked list. -
Implement
Sparse Array
. -
Implement operations on
Binary Search Tree
:- Insertion
- Deletion
- Search
- Traversals (using recursion)
- Inorder
- Preorder
- Postorder
-
Implement traversals on
Binary Search Tree
(using stacks)- Inorder
- Preorder
- Postorder
-
Implement
graph traversal
:- Depth-first Search (DFS).
- Breadth-first Search (BFS).
-
Make a menu driven program to perform various
sorting
techniques- Insertion sort
- Merge sort
- Heap sort
- Quick sort
- Counting sort
- Radix sort
- Bucket sort
-
Implement
AVL tree
-
Implement Kruskal’s and Prim’s
Minimum Spanning Tree
algorithms. -
Make a menu driven program to perform various
shortest path algorithms
- Floyd Warshall, Bellman-Ford, Dijkstra. -
Write a program to implement
Dynamic Programming Algorithms
- Matrix Chain Multiplication, Longest Common Subsequence. -
Implement
Huffman Code Algorithm
.
back to table of contents