In graph theory, breadth-first search (BFS) is a strategy for searching in a graph when search is limited to essentially two operations: (a) visit and inspect a node of a graph; (b) gain access to
DFS (Depth First Search)
Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. One starts at the root (selecting some arbitrary node as the root in the case of a graph) and explores
Doubly linked list
In computer science, a doubly-linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains two fields, called links, that are references to the previous
Circular Linked List
In the last node of a list, the link field often contains a null reference, a special value used to indicate the lack of further nodes. A less common convention is to make it point
Singly linked list
In computer science, a linked list is a data structure consisting of a group of nodes which together represent a sequence. Under the simplest form, each node is composed of a datum and a reference
… Read More Find loop in Singly linked list
There are several ways to find loop in singly linked list,
Loop Node5 Next pointer is point to Node3 in Singly Linked List 1 ---- 2 ---- 3 ---- 4 ---- 5 |_____________|
- Hashmap
- Floyd’s
Reversal of LinkedList
Reversal of linked list simplified With Three Pointer Without Recursion