Skip to content

DevendraCollage/DSA-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 

Repository files navigation

1. Practical Lab-1

Solution For Practical-Lab-1

1. Write a program to find factorial of a number using loop and recursion.
2. Write a program to find factors of a given number.
3. Write a program to check whether a number is prime or not.
4. Write a program to find GCD using loop and recursion.
5. Write a program to calculate power using loop and recursion.
6. Write a program to display prime numbers between two intervals.

2. Practical Lab-2

Solution For Practical-Lab-2

1. Read n numbers in an array and print their sum and average.
2. Write a program to find the largest element in an array.
3. Read n numbers in an array then read two different numbers, replace 1st number with 2nd number in an array and print the final array.
4. Write a program to copy all the elements of one array to another array.
5. Read n numbers in an array and print it in ascending order.
6. Write a program to find common elements between two arrays.
7. Write a program to find common elements between two arrays.

3. Practical Lab-3

Solution For Practical-Lab-3

1. Read two 2x2 matrices and perform addition of matrices into third matrix and print it.
2. Read two matrices, first 3x2 and second 2x3, perform multiplication operation and store result in third matrix and print it.
3. Write a program to find transpose of a square matrix - transpose of matrix means swapping the row and column of the original matrix.

4. Practical Lab-4

Solution For Practical-Lab-4

1. Read n numbers in an array and print it using pointer.
2. Write a C program to swap two numbers, calling an UDF by value.
3. Write a C program to swap two numbers, calling an UDF by reference.
4. Write a program to 􀆒nd largest element in the array using Pointer.
5. Write a program to check if the string is a palindrome or not using Pointer.

5. Practical Lab-5

Solution For Practical-Lab-5

1. Create a structure Employee_Detail (Employee_id, Name, Designation, Salary). Write a program to read the detail from user and print it.
2. Create an array of structure Student_Detail (Enrollment_no, Name, Sem, CPI) for 5 students, scan their information and print it.
3. Create a structure Employee_Detail (Employee_id, Name, Designation, Salary). Write a program to read the detail from user and print it using Structure Pointer.
4. Write a program to add two complex numbers by passing structure to a Function.

6. Practical Lab-6

Solution For Practical-Lab-6

1. Write a menu driven program to perform following operations on Stack: PUSH, POP, PEEP, CHANGE and DISPLAY.
2. Write a program to reverse a string using Stack.

7. Practical Lab-7

Solution For Practical-Lab-7

1. Write a program to convert the given infix notation to postfix notation.
2. Write a program to convert the given infix notation to prefix notation.

11. Practical Lab-11

Solution For Practical-Lab-11

1. Write a program to get n elements of an array from user and print those elements using pointer.
2. Write a program to display n elements and sum of those elements using dynamic memory allocation. Also release the memory occupied after displaying.

12. Practical Lab-12

Solution For Practical-Lab-12

1. Write algorithms to perform following operations on Singly Linked List:
    ◦ Insert a node at the beginning of the linked list
    ◦ Insert a node at the end of the linked list
    ◦ Delete a node
2. Write a menu driven program to implement following operations on the singly linked list:
    ◦ Insert a node at the end of the linked list
    ◦ Delete the first node of the linked list
    ◦ Delete the last node of the linked list
    ◦ Display the list
    ◦ Delete a specific node
    ◦ Count number of nodes

13. Practical Lab-13

Solution For Practical-Lab-13

1. Write a menu driven program to implement following operations on the Ordered Linked List.
    ◦ Insert a node such that linked list is in ascending order
    ◦ Display the list
    ◦ Delete a 􀆒rst node of the linked list
    ◦ Delete a last node of the linked list
    ◦ Delete a specific node

14. Practical Lab-14

Solution For Practical-Lab-14

1. Write a program to implement stack using linked list.
2. Write a program to implement queue using linked list.

15. Practical Lab-15

Solution For Practical-Lab-15

2. Write a menu driven program to implement following operations on the Circular Linked List.
    ◦ Insert a node at the beginning of the linked list
    ◦ Insert a node at the end of the linked list
    ◦ Display the list
    ◦ Delete a specific node

18. Practical Lab-18

Solution For Practical-Lab-18

1. Read n numbers in an array from user and sort them in ascending order using Bubble Sort algorithm and print sorted array.
2. Read n numbers in an array from user and sort them in ascending order using Selection Sort algorithm and print sorted
array.
3. Read n numbers in an array from user and sort them in ascending order using Insertion Sort algorithm and print sorted
array.
4. Read n numbers in an array from user and sort them in ascending order using Quick Sort algorithm and print sorted array.

About

This repository Contains the Solutions for the DSA Labs Using the C-Language of all the labs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages