Data Structure using C
Name : ___________________________
Reg. No:___________________________
Course : BCA Second Semester_______
College : ___________________________
___________________________
,
,Course Code: BCA Second Semester Examination Assessment Marks : 80
Course Title: Data Structures Lab (SEP 2024-25) Practical:(IA) Assessment Criteria Marks: 20
Part A:
1. Write a C program to create a structure Employee that stores empno, name, age, salary and include
the following tasks:
I. Accept details of N employees
II. Display the details of N employees in the following format
2. Write a C program to create array of structures.
3. Write a C program to count number of vowels and consonants using pointers.
4. Write a C program to create file of N students, it should contain Rollno, name, marks in two subjects. Using the
above created file, create an output file which contains Rollno, name, marks in two subjects, total and average.
5. Write a C program to create a character file and count the number of characters, words and blank spaces present in it.
6. Write a C program to demonstrate Dynamic Memory Allocation functions.
7. Write a C program to demonstrate the working of stack of size N using an array the elements of the stack may be
assumed to be of type integer by creating an array, the operations to be supported are 1. PUSH 2. POP 3. DISPLAY.
The program should print the appropriate message for stack underflow and overflow.
8. Write a C program to implement operations of stack using structures.
9. Write a C program to convert and print valid fully parenthesized infix arithmetic expression to postfix.
10. 10Write a C program to simulate the working of a Queue using an array provide the operations QINSERT, QDELETE
and QDISPLAY. Check the queue status for empty and full.
Part B:
1. Write a C program to implement operations of Queue using structures.
2. Write a C program to simulate the working of a Circular Queue using an array provide the operations CQINSERT,
CQDELETE and CQDISPLAY. Check the queue status for empty and full.
3. Write a C program to demonstrate the working of a dequeue using array and provide for all its basic operations.
4. Write a C program to find the Binomial Coefficient using recursion.
5. Write a C program find the nth Fibonacci number by using recursion.
6. Write a C program to find GCD of two numbers using recursion.
7. Write a C program to simulate working of tower of Hanoi for N disks. Print the total number of moves taken
8. Using dynamic variables and pointers write a C program to construct a singly linked list consisting of the following
information in each node: Rollno(integer), name(string):The operations to be supported are:
LINSERT – Inserting a node in the front of the list
LDELETE – Deleting a node based on rollno
LSEARCH – Searching a node on rollno
LDISPLAY – Displaying the data in all the nodes
9. Write a C program to create a doubly linked list where each node consists of the following
information: left link, data(integer), right link.
The operations to be supported are:
INSERT – Insert a node at the end of the doubly linked list
DELETE – Delete any node from the doubly linked list
DISPLAY – Display the data in all the nodes
10. Using dynamic variables and pointer create a binary search tree of integers and perform the following operations:
1. Given a key perform a search in the binary search tree and insert the key if it is not a duplicate key.
2. Traverse the tree using PREORDER, INORDER & POSTORDER methods
Examination:
• One Question has to be given from the above list (Carries 35 Marks)
• One more question has to be given by the examiner by his choice and that question need not be in the list
(Carries 35 Marks).
• Student has to answer and execute both questions.
,