Join Our WhatsApp Group Join Subscribe Now!

313301 DSU Practical No.13: Write a 'C' Program to Implement Singly Linked List with Operations: (i) Insert at end (ii) Insert after (iii)Delete(iv) Display

313301 DSU Practical No.13: Write a 'C' Program to Implement Singly Linked List with Operations: (i) Insert at end (ii) Insert after (iii)Delete(iv) D

 313301 DSU Practical No.13: Write a 'C' Program to Implement Singly Linked List with Operations: (i) Insert at end (ii) Insert after (iii)Delete(iv) Display 

A Singly Linked List is a linear data structure in which the elements are not stored in contiguous memory locations. Each component is connected only to its next element using a pointer.

313301 DSU Practical No.13

The list is not required to be continuously present in the memory. The node can reside anywhere in the memory and be linked together to make a list. This achieves optimized utilization of space. list size is limited to the memory size and doesn't need to be declared in advance.

C Program Code


Algorithm


Flow chart

Draw a flow chart using the below instructions:


Result (Output of Program)

Linked List after insertion at end: 
10 -> 20 -> 30 -> 40 -> NULL
Linked List after inserting 25 after 20: 
10 -> 20 -> 25 -> 30 -> 40 -> NULL
Linked List after deleting 30: 
10 -> 20 -> 25 -> 40 -> NULL

Practical Related Questions

1. Write a function to insert a node at the end in a Singly Linked List.

Answer:


2. Write a function to check whether a singly linked list is a palindrome or not.

Answer:


Exercise

1. Write applications of Singly Linked List.

Answer:
  • Implementation of stacks and queues: Singly linked lists can be used as the underlying data structure for stacks (LIFO) and queues (FIFO).
  • Polynomial representation: Linked lists can efficiently represent polynomials, allowing for arithmetic operations like addition and multiplication.
  • Graph representation: Adjacency lists, a common representation of graphs, utilize linked lists to store neighbors of each vertex.
  • Hash tables: Linked lists can be used to resolve collisions in hash tables

2. Explain the procedure to find middle of singly linked list.

Answer:


Conclusion

We completed  313301 DSU Practical No.13 in which we Write a 'C' Program to Implement Singly Linked List with Operations: (i) Insert at end (ii) Insert after (iii)Delete(iv) Display 

About the Author

Hi everyone, I'm Suraj Diware, and I'm passionate about helping students succeed in MSBTE programs. This blog is dedicated to providing clear and concise explanations of MSBTE curriculum topics, along with practical tips and resources to sup…

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.