Skip to content

Latest commit

 

History

History
96 lines (52 loc) · 4.03 KB

README.md

File metadata and controls

96 lines (52 loc) · 4.03 KB

Data-Structures-Lab-Programs

9 Lab programs in total

  1. Design and Implement a program in C on Frequency Histogram, that builds a frequency array for data values in the range 1 to n and then prints their histogram. The program should,

    a. Read, Store and Print the data in an array.

    b. Analyze the data in the array, one element at a time. Add 1 to the corresponding element in a frequency array based on the data value.

    c. Print a histogram using asterisks for each occurrence of an element.

  2. Design and Implement a program in C that simulates a mouse in a maze. The entrance spot, where the mouse starts its journey, is chosen by the user who runs the program. It can be changed each time. The sample maze is represented below:

    image

    The program must print the path taken by the mouse from the starting point to the final point, including all spots that have been visited and backtracked.

  3. Design and Implement a program in C for the following Stack Applications,

    a. Evaluation of Suffix expression with single digit operands and operators: +, -, *, /, %, ^

    b. Conversion of Arithmetic Expressions

  4. Design and Implement a program in C to categorize the data. Consider the following sample list of numbers

    image

    Categorize and sort them into different groups as mentioned below:

    Group 1: Less than 10

    Group 2: Between 10 and 19

    Group 3: Between 20 and 29

    Group 4: 30 and greater

  5. Design and Implement a menu driven program in C for the following operations on Doubly Linked List (DLL) of Student Data with the fields: USN, Name, Dept, Marks, Phone Number

    a. Create a DLL of N Students Data by using end insertion.

    b. Display the status of DLL and count the number of nodes in it

    c. Perform Insertion and Deletion at End of DLL

    d. Perform Insertion and Deletion at Front of DLL

    e. Display the total and average marks for each student

  6. Design and Implement a program in C for the following operations on Singly Circular Linked List (SCLL) with header nodes,

    a. Represent and Evaluate a Polynomial P(x,y,z) = 6x^2y^2z - 4yz^5 + 3x^3yz + 2xy^5z - 2xyz^3.

    b. Find the sum of two polynomials POLY1(x,y,z) and POLY2(x,y,z) and store the result in POLYSUM(x,y,z).

  7. Design and Implement a program in C that reads a list of names and telephone numbers to inserts them into a Binary Search Tree for the following operations,

    a. Search the list for a specified name.

    b. Insert a new name.

    c. Delete an existing name.

    d. Traverse the phone list using Inorder, Preorder and Postorder.

  8. A company has seven top officers working for it. They are each fluent in at least one language according to the following sample table:

    image

    Design and Implement a program in C for the following operations on Graphs (G):

     a. Create a graph using adjacency matrix indicating people who can communicate directly with each other.
     
     b. Print all the officers which are reachable from a given officer as a starting node in a digraph.
         Example: An officer wants to send a message to each other officer: A message comes to an 
         officer, he reads it and transmits it to another officer possibly after translation to someone who 
         has not read it.
    
  9. Design and Implement a program in C that uses Hash Function H:K->L as H(K)=K mod m(reminder method) and implement hashing technique to map a given key K to the address space L. Resolve the collision (if any) using linear probing.