Constant

Bubblesort

Bubble Sort is a simple comparison-based sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. This process is repeated until the list is sorted.

Heapsort

A sorting technique that uses a binary heap, first building a max-heap and then repeatedly extracting the maximum element, ensuring efficient sorting.

  • Time complexity is Linearithmic, i.e. O(n log(n))
  • Space complexity is Constant, i.e. O(1)

Insertion Sort

A sorting technique that builds the sorted array one element at a time, inserting each new element into its proper position among already-sorted elements.

  • Time complexity is Quadratic, i.e. O(n^2)
  • Space complexity is Constant, i.e. O(1)

Linked List

A data structure where each element contains a value and a reference to the next node, supporting efficient insertion and deletion operations.

  • Time complexity for access and search is Linear, i.e. O(n)
  • Time complexity for insertion and deletion is Constant, i.e. O(1)
  • Space complexity is Linear

Longest Common Prefix

An algorithm for finding the longest common prefix among a set of strings.

  • Time complexity is Linear, i.e. O(n)
  • Space complexity is Constant, i.e. O(1)

Queue

A linear collection following the First-In-First-Out (FIFO) principle, supporting operations like enqueue and dequeue, useful in task scheduling.

  • Time complexity for access and search is Linear, i.e. O(n)
  • Time complexity for insertion and deletion is Constant, i.e. O(n)
  • Space complexity is Linear

Recursive Depth-First Search

A recursive depth-first search algorithm that explores branches deeply before backtracking, managing traversal state with recursion.

  • Time complexity of insertion and deletion is Constant, i.e. O(1)
  • Time complexity of search is is Linear, i.e. O(n)
  • Space complexity is Linear, i.e. O(n)

Selection Sort

Selection sort is a comparison-based sorting algorithm that divides the input list into two parts: the sublist of items already sorted, which is built up from left to right at the front (left) of the list, and the sublist of items remaining to be sorted that occupy the rest of the list. Initially, the sorted sublist is empty and the unsorted sublist is the entire input list. The algorithm proceeds by finding the smallest (or largest, depending on sorting order) element in the unsorted sublist, exchanging (swapping) it with the leftmost unsorted element (putting it in sorted order), and moving the sublist boundaries one element to the right.

Stack

A stack is a linear data structure that follows the Last In First Out (LIFO) principle. Elements are added and removed from the same end, called the top. Common operations include push (add an element), pop (remove the top element), and peek (view the top element without removing it). Stacks are used in various applications like function call management, expression evaluation, and backtracking.

Trie Symbol Table

The Trie Symbol Table is a data structure designed to efficiently store and retrieve key-value pairs where the keys are strings. It organizes data into a tree-like structure, where each node represents a character, and paths from the root to nodes represent strings.