Skip to content

Commit 0448efd

Browse files
authored
Create README.md
1 parent 2240a2b commit 0448efd

File tree

1 file changed

+59
-0
lines changed
  • src/test/java/com/thealgorithms/datastructures/lists

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
## Linked List
2+
### Description
3+
4+
LinkedList is a data structure in which data is stored in a linear manner. It usually contains a data field and a link to the memory location of the next node.
5+
6+
### Structure
7+
8+
9+
class LinkedList<E>{
10+
E value;
11+
LinkedList next;
12+
}
13+
14+
15+
The next variable points to the next node in the data structure and value stores the data. Any number of nodes can be linked in this manner. The structure will be:
16+
17+
18+
### Properties
19+
1. Linked list does not provide indexing like an array. For accessing a node at position p , &theta;(p) nodes need to be accessed.
20+
2. Main advantage of linked list is addition and removal of nodes near the end and beginning of lists. It can be done just by updating the link (O(1) time)
21+
3. Unlike an array, its size is not predefined. So any number of nodes can be appended.
22+
23+
### File descriptions:
24+
25+
1.CircleLinkedList.java : A circular linked list where the next pointer of the last node points to the first node of the linked list.
26+
27+
2.CircularDoublyLinkedList.java : A circular doubly linked list with next and prev pointers, where the last node points back to the first node.
28+
29+
3.SinglyLinkedList.java : The classic single linked list implementation.
30+
31+
4.SinglyLinkedListNode.java : Node class used for singly linked lists.
32+
33+
5.CountSinglyLinkedListRecursion.java : Recursively counts the size of a singly linked list.
34+
35+
6.CreateAndDetectLoop.java : Creates and detects a loop in a linked list.
36+
37+
7.DoublyLinkedList.java : A modification of singly linked list with a prev pointer to point to the previous node.
38+
39+
8.MergeKSortedLinkedList.java : Merges K sorted linked lists using merge sort.
40+
41+
9.MergeSortedSinglyLinkedList.java : Merges two sorted singly linked lists.
42+
43+
10.MergeSortedArrayList.java : Merges sorted array lists (linked list variant).
44+
45+
11.QuickSortLinkedList.java : Implements quicksort on a linked list.
46+
47+
12.RandomNode.java : Selects a random node from a given linked list and displays it.
48+
49+
13.ReverseKGroup.java : Reverses nodes in k-sized groups in a linked list.
50+
51+
14.RotateSinglyLinkedLists.java : Rotates a singly linked list by k positions.
52+
53+
15.SearchSinglyLinkedListRecursion.java : Searches a node in a singly linked list recursively.
54+
55+
16.SortedLinkedList.java : Implements a linked list that maintains sorted order on insertion.
56+
57+
17.CursorLinkedList.java : Implements linked list using cursor-based approach.
58+
59+
18.SkipList.java : Stores a sorted list of elements using a linked list hierarchy connecting subsequences of elements.

0 commit comments

Comments
 (0)