0% found this document useful (0 votes)
9 views2 pages

Start

The document explains the basic concepts of a linked list, including the definitions of Start (Head), End (Tail), Before, and After nodes with examples. It also provides syntax for creating linked lists in C# and methods for adding nodes. Additionally, it includes control structures like while and if statements for managing code execution based on conditions.

Uploaded by

mactadeja84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Start

The document explains the basic concepts of a linked list, including the definitions of Start (Head), End (Tail), Before, and After nodes with examples. It also provides syntax for creating linked lists in C# and methods for adding nodes. Additionally, it includes control structures like while and if statements for managing code execution based on conditions.

Uploaded by

mactadeja84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Start (Head) – The first node in the list. It helps begin the traversal of the list.

 Example: If the list is 10 → 20 → 30, then Start (Head) = 10.


End (Tail) – The last node in the list. It usually has its Next pointer as null
(meaning it points to nothing).
 Example: If the list is 10 → 20 → 30, then End (Tail) = 30.
Before – The node that comes right before another node.
 Example: In 10 → 20 → 30, the node before 30 is 20.
After – The node that comes right after another node.
 Example: In 10 → 20 → 30, the node after 10 is 20.

SYNTAX
LinkedList<int> l = new LinkedList<int>();

LinkedList <String> l = new LinkedList <String>();

l.AddFirst()
l.AddLast()
l.AddAfter()
l.AddBefore()

while (condition)
{
// Code to execute as long as the condition is true
}

if (condition)
{
// Code to execute if the condition is true
break;
}
console.ReadKey();
console.ReadLine();

public Node(int data)


{
this.Data = data;
this.Next = null;
}

You might also like