Professional Documents
Culture Documents
and Algorithm
Lab
Code – CSS 52
II SEMESTER ALL SECTIONS
Attendanc
e Viva
Lab
Performanc Exam
e Copy
CLASS 2023
Assignment - 1
1. Write a program in C to insert an element at a given location in a non-empty array.
3. Write a program in C to merge two arrays for the following two cases-
a.) Arrays are sorted.
b.) Arrays are unsorted.
4. Write a C program to count the number of occurrences of a specific element for a given
integer array of fixed length.
a.) without dynamic memory allocation
b.) with dynamic memory allocation
5. Write a C program to read a one dimensional array, print sum of all elements along with
inputted array elements using Dynamic Memory Allocation.
6. Write a program to find out the largest number using Dynamic Memory Allocation.
2. Given an integer array, reshuf fle the array where all odd elements will come before the even elements in
sorted order. Example is given below -
3. Write a program to reverse the sequence of an array elements after a given location to the end of the
array. Example is given below –
4. Write a C program to read and print the N student details using structure and Dynamic Memory Allocation.
5. Create a structure named "Point" with members for x-coordinate (integer) and y-coordinate (integer).
Write a program to store information for ten points using an array of "Point" structures and f ind the point
closest to the origin (0, 0).
Original Matrix
1 0 0 0
using Dynamic Memory Allocation.
0 0 1
0 0 2 0 1 2 2
3. Write a C program to find the Transpose of a matrix. 2 1 3
0 anti-diagonal
4. Write a program in C to calculate the sum of elements on the 3 0 0 of a square matrix.
Input Matrix
Diagonal
1 2 3 1,5,9
Anti-Diagonal
4 5 6 3,5,7
5. Write a program in C to print the boundary elements of a given matrix in a clockwise or counterclockwise direction.
7 8 9
6. Write a program in C to find the saddle point in a matrix.
1 2 3
A saddle point of a matrix is an element which is both the largest
element in its column and the smallest element in its row. Here 7 is a saddle point. 4 5 6
7 8 9
CLASS 2023 - 2024
Assignment - 4
1. Write C-programs for Binary Search for both recursive and non-recursive versions. Show each iterations.
2. Write a menu driven program in C to perform following operations on a singly linked list:
a) insert an element at the beginning of the linked list
b) insert an element at the end of the linked list
c) insert an element in a given location of the linked list.
d) insert an element after a specific element.
e) display the elements from the beginning to end.
f) display the elements from the end to beginning.
1. Write a menu driven program in C to perform following operations on a singly linked list:
a) create a linked list
b) display the linked list
c) delete an element at the beginning of the linked list.
d) delete an element at the end of the linked list.
e) delete an element at the i-th position of the linked list.
f) delete an element after a specific element.
3. Write a menu driven program in C to perform following data structure operations on stack using array.
a) CREATE
b) PUSH
c) POP
d) PEEK [Extract the information from top of the stack]
e) UPDATE [Update ith information from the top of the stack]
f) DISPLAY [Display all the elements stored in a stack]
4. Write a menu driven program in C to perform following data structure operations on stack using linked list.
a) CREATE
b) PUSH
c) POP
d) PEEK [Extract the information from top of the stack]
e) UPDATE [Update ith information from the top of the stack]
f) DISPLAY [Display all the elements stored in a stack]
3. Write a C program to check if a given expression containing parentheses (e.g., "{([])}") is balanced
using STACK.
2. Write a menu driven program in C to perform following data structure operations on circular queue using array.
a) ENQUEUE
b) DEQUEUE
c) queueFRONT [Extract the information from FRONT of the queue]
d) queueREAR [Extract the information from REAR of the queue]
e) queueCOUNT [Return the number of elements in the queue]
f) DISPLAY [Display all the elements stored in a queue]
3. Write a menu driven program in C to perform following data structure operations on linear queue using linked-list.
a) CREATE LINKEDLIST
b) ENQUEUE
c) DEQUEUE
d) queueFRONT [Extract the information from FRONT of the queue]
e) queueREAR [Extract the information from REAR of the queue]
f) queueCOUNT [Return the number of elements in the queue]
g) DISPLAY [Display all the elements stored in a queue]
3. Write a C program to merge two sorted Linked Lists into a single sorted Linked List.
1. Write a menu-driven program in C to implement a binary tree using a linked list and traverse the
following techniques:
i) Inorder
ii) Preorder
iii) Postorder