Skip to content
View suryamalarv's full-sized avatar

Block or report suryamalarv

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
suryamalarv/README.md

1. Singly Linked List

  • Introduction:
    • What is a linked list?
    • Differences from arrays.
    • Importance and where they are used.
  • Structure of a Node:
    • struct Node definition in C.
    • Explanation of pointers and how they link nodes together.
  • Operations on Singly Linked List:
    • Insertion:
      • At the beginning.
      • At the end.
      • At a specific position.
    • Deletion:
      • Deleting the first node.
      • Deleting the last node.
      • Deleting a node at a specific position.
    • Traversal:
      • Moving through the nodes using pointers.
      • Printing values in the list.
    • Search Operation:
      • Searching for an element in the linked list.
  • Advantages of Singly Linked Lists:
    • Dynamic size.
    • Ease of insertion and deletion.
  • Disadvantages:
    • No efficient backward traversal.
    • Extra memory for pointers.
  • Applications of Singly Linked List:
    • Implementation of stacks and queues.
    • Dynamic memory allocation.
    • Managing free memory (Garbage collection in memory management systems).

2. Doubly Linked List

  • Introduction:
    • Definition and differences from singly linked lists.
  • Structure of a Node:
    • struct Node definition in C (two pointers: next and prev).
  • Operations on Doubly Linked List:
    • Insertion:
      • At the beginning.
      • At the end.
      • At a specific position.
    • Deletion:
      • Deleting the first node.
      • Deleting the last node.
      • Deleting a node at a specific position.
    • Traversal:
      • Forward traversal using next.
      • Backward traversal using prev.
    • Search Operation:
      • Searching for an element in the doubly linked list.
  • Advantages of Doubly Linked Lists:
    • Efficient backward and forward traversal.
    • Flexibility in insertion and deletion operations.
  • Disadvantages:
    • Extra memory for prev pointer.
    • More complex implementation than singly linked lists.
  • Applications of Doubly Linked List:
    • Undo/redo functionality in software (e.g., text editors).
    • Browser navigation (back and forward functionality).
    • Managing resources in operating systems.

3. Comparison: Singly vs Doubly Linked List

  • Memory usage.
  • Efficiency in traversal.
  • Use cases where one is preferred over the other.

4. Real-Time Example: Browser Navigation System

  • Scenario Explanation:
    • How web browsers use doubly linked lists to manage "back" and "forward" navigation.
  • Implementation in C:
    • Define a structure representing browser history as a doubly linked list.
    • Demonstrate adding new URLs to history (insertion).
    • Moving back and forward (traversal using next and prev).
    • Deleting a specific URL or managing memory.
  • Code Snippets:
    • Sample code to show how this could be implemented in C.

5. Conclusion

  • When to use singly vs doubly linked lists.
  • Real-world significance in various software systems.

Popular repositories Loading

  1. Web_server Web_server Public

    Forked from Karthi-Govindharaju/Web_server

    Creating a sample web server

  2. Swapping-two-values Swapping-two-values Public

    Forked from ArchanaSharikalHarinarayanan/Swapping-two-values

    Swapping two values

  3. Circulate-the-values-of-N-variables Circulate-the-values-of-N-variables Public

    Forked from ArchanaSharikalHarinarayanan/Circulate-the-values-of-N-variables

    Circulate the values of N variables