# C Programming Examples on Linked List

Here is the listing of C programming examples on Linked Lists.

#### 1. C Examples on Creating and Displaying the elements of a Linked List

A Linked List is a dynamic data structure which contains memory blocks occupying random memory locations. The elements in the Linked List are called nodes. The C programs in the following section focuses on the Creation of a Linked List and displays the elements(nodes) of a Linked List. The other program in the sections reads the Linked List in reverse.

C Program to Create a Linked List & Display the Elements in the List C Program to Read a Linked List in Reverse |

#### 2. C Examples on Search and Display functions of a Linked List

The following section deals with the Search and Display functions which are applied to the Linked List. The Search function searches for the specified element in the Linked List and the Display Function is used to display the elements of the Linked List. The section contains programs which use the Search function to search for an element in the Linked List using Recursion and without using Recursion. The remaining programs use the Display function to Display the nodes of a Linked List using Recursion and without using Recursion and to Display the nodes of a Linked List in reverse using Recursion and without using Recursion.

#### 3. C Examples on implementation of Count, Length and Print operations on a Linked List

The following section contains C Programs which performs operations like Count,finding the length, and printing the elements of the Linked List. The programs count the number of occurrences of an element in the Linked List using Recursion and without Using Recursion, finds the length of the Linked List using Recursion and without using Recursion and prints the alternate nodes in a Linked List using Recursion and without using Recursion.

#### 4. C Examples on implementation of other Data Structures using Linked List

The following section provides various implementations of other Data Structures using Linked List. It has programs to implement a Stack, to implement a Queue, To implement a Doubly Linked List, a Circular Doubly Linked List and a Binary Tree using Linked List. Each node in a Doubly Linked List contains two address fields, one field store the address of the previous node with which it is linked and the other address field stores the address of the next node to be followed. A Circular Doubly Linked List is a doubly-linked-list in which the head element’s previous pointer points to the tail element and tail element’s next pointer points to the head element. A Binary Tree is a group of nodes where each node contains a left reference, a right reference and a data element. The section also contains a C program which demonstrates the operations of a Singly Linked List. In a singly linked list, each node has a single link to the other node.

#### 5. C Examples dealing with the operations on the Elements of a Linked List

This section contains C Programs which performs operations on the elements of a Linked List. These operations include addition of the corresponding positioned elements of 2 Linked Lists, checking if the two Linked Lists are same, checking if the given Singly Linked List is a Palindrome, Finding the number of occurrences of all the elements in a Linked List. The section also involves finding the element that is common to both the Linked Lists and finding the largest element in a Doubly Linked List.

#### 6. C Examples on Print, Reverse and Read operations

This sections has C programs which perform Print, Reverse and Read operations. Print operation prints the specified contents of a Linked List, Read operation reads the content of the Linked List, Remove operation removes the specific contents of a Linked List and Reverse operation reverses the contents of the given Linked List. The programs in this section prints the middle most node of a Linked List, Reads a Linked List in reverse, removes the duplicate elements from the Linked List, reverses a Linked List and reverses the first N elements of a Linked List.

#### 7. C Examples on Binary Tree Implementation using Linked List

This section deals with implementation of other data structures like Ordered Binary Tree, Balanced Binary Search Tree using a Linked List. It also has programs which convert one form of Linked List to another. A balanced binary tree is a tree where every leaf is “not more than a certain distance” away from the root than any other leaf. The following programs convert a ordered Binary Tree Into a Circular Doubly Linked List, Constructs a Balanced Binary Search tree having the same data members as the given Doubly Linked List., Converts a Binary Tree into a Singly Linked List and converts a singly Linked List into a Circular List.

#### 8. C Examples on Interchange and Modify Operations

The programs in this section perform Interchange operation. They interchange the two adjacent nodes of a circular Linked List by touching the key field and without touching the key field. The other program in the section performs the Modify Operation. It modifies the given Linked List such that all the even numbers appear before the odd numbers in the given Linked List. The section has some special programs which solve Mathematical Problems like Josephus Problem using Linked List and a program which performs Infinite Precision Arithmetic.