Dfs Practical List - 2019

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Banarsidas Chandiwala Institute of Information and Technology

(Affiliated to GGSIP University)

Data & File Structures Lab


(MCA 152)

1. Write a C program to find the sum of individual digits of a positive integer.

2. Write C programs that use both recursive and non-recursive functions


i) To find the factorial of a given integer.
ii) To find the GCD (greatest common divisor) of two given integers.
iii) To solve Towers of Hanoi problem.

3. Program to implement of sparse matrix using array in Row major representation.

4. Write a C program to find both the larges and smallest number in a list of
integers.

5. Write a C program that uses functions to perform the following:

i) Addition of Two Matrices

ii) Multiplication of Two Matrices

iii) Transpose of Matrices

6. Program for creation of adjacency matrix.

7. Program to eliminate duplicate elements in the array.

8. Program to reverse the string using stack.

9. Write a menu driven program to search an element, to find maximum and


minimum element and count the number of elements in the linked list.

10. Program to create a Linked List & perform the following operations:
i. Insert an element in the beginning
ii. Insert an element at the end
iii. Insert an element in between
iv. To delete a node
v. Display the nodes
vi. Count elements
11. Modify the above program’s data structure to double linked list structure.
12. Program to create Stack using Array and Linked List and perform push and pop
operations.
13. Write C programs that implement Queue (its operations) using
i) Arrays ii) Pointers
14. Program to create double ended Queue using Linked List and perform Add and
Delete operations.
15. Program for Polynomial creation using Linked List and perform operations like
addition and subtraction on polynomial representation in one variable.
16. Program for Conversion of given Arithmetic Expression (A+B) (C+D) from
infix to postfix notation.
17. Choose a number, reverse its digits and add it to the original. If the sum is not a
palindrome, repeat this procedure. If a resulting palindrome does not exist within 10
iterations (additions), your program must compute the number of decimal digits in
the last iteration that is obtained through the additions. Implement it using Stack.
e.g.
Choose no. : 1234 /895 Reverse its digit: 4321/598
Add : 1234 /1439 Result: 5555 / 9341
Check whether it’s Palindrome or Not?
18. Program to implement Graph Traversal using BFS and DFS.
19. Program to create a BST
i) Insert a node at a particular position
ii) Search a node
iii) Delete a node from a given position
20. Write C programs that use both recursive and non recursive functions to
perform the following searching operations for a Key value in a given list of integers
i) Linear search ii) Binary search
21. Write a C program that uses Stack operations to perform the following:
i) Converting infix expression into postfix expression
ii) Evaluating the postfix expression
22. Write a C program that uses functions to perform the following:
i) Creating a Binary Tree of integers
ii) Traversing the above binary tree in preorder, inorder and postorder.
23. Program to implement selection/Insertion/ Heap sorting algorithm.
24. Program to implement sorting algorithms and also compute time taken by each
Sorting algorithm on similar set of data. State it’s Best, Average and Worst case
complexity.
i) Insertion sort
ii) Selection Sort
iii) Quick Sort
iv) Merge Sort
v) Shell Sort
vi) Heap Sort
vii) Radix Sort

You might also like