Algorithms

Detecting a Loop in Linked Lists and Finding a Start of the Loop

Linked List is a linear data structure where elements’ data part & address part are stored separately. Each node inside a linked list is linked using pointers and addresses. If there is a loop inside a linked list, how can it be detected? And if a loop is detected, how can the start of the loop be identified?

2021-07-12
10 min reading
Algorithms

Visual Understanding of Insertion Sort Algorithm

Insertion sort is an in-place comparison-based algorithm. In the best case scenario, in which the array is nearly-sorted, it has $O(N)$ time complexity. In the worst case scenario, in which the array is reserve-sorted, it has $O(N^2)$ time complexity.

2020-09-01
5 min reading
Algorithms

Visual Understanding of Selection Sort Algorithm

Selection sort is an in-place comparison sorting algorithm. It has an $O(N^2)$ time complexity at all times. Effectively, the only reason that schools still teach selection sort is because it's an easy-to-understand, teachable technique, on the path to more complex and powerful algorithms.

2020-08-19
5 min reading