CodePedia

The Universal Code Encyclopedia for Python, JavaScript, C++, Java, C#, and Go.

Categories

Mathematics

Prime, Factorial, GCD, LCM, Fibonacci, and Power algorithms.

Browse Math →

Sorting

Bubble Sort, Quick Sort, and Merge Sort implementations.

Browse Sorting →

Strings

Reverse String and Palindrome Check across all 6 languages.

Browse Strings →

Searching

Linear Search and Binary Search across all 6 languages.

Browse Searching →

Arrays

Insert, Delete, Reverse, Find Max and Min operations.

Browse Arrays →

Recursion

Recursive Factorial, Fibonacci, and Tower of Hanoi.

Browse Recursion →

Stack

LIFO structure — Push, Pop, and Peek operations.

Browse Stack →

Queue

FIFO structure — Enqueue and Dequeue operations.

Browse Queue →

Linked List

Insert, Delete, Search, and Traverse a singly linked list.

Browse Linked List →

2D Traversal

Grid traversal in all 6 directions — horizontal, vertical, and all 4 diagonals.

Browse Traversal →

ā± Big O Cheat Sheet

O(1)
Constant Stack push, array access
O(log n)
Logarithmic Binary search, GCD
O(√n)
Square Root Prime check
O(n)
Linear Linear search, traversal
O(n log n)
Linearithmic Merge sort, Quick sort
O(n²)
Quadratic Bubble sort, nested loops
O(2^n)
Exponential Recursive Fibonacci, Hanoi
O(n!)
Factorial All permutations

What is Big O?

Big O notation describes how an algorithm's runtime or memory usage grows as the input size n increases. It measures the worst case — how slow can it get?

Lower is always better. An O(1) algorithm runs in the same time whether n=10 or n=1,000,000. An O(n²) algorithm on 1,000 items does 1,000,000 operations.