Skip to main content

Algorithms

2024


Binary Search Trees

6 mins
A Binary Search Tree (BST) is a data structure that enables fast data retrieval, insertion, and deletion. Each node has two children at most, with the left child"s value being less than the parent"s, and the right child"s value being greater.

Big O Notation

3 mins
Big O notation is a mathematical notation that describes the limiting behavior of a function when the argument approaches infinity. It is used to analyze the efficiency of algorithms and to compare the performance of different algorithms.

Merge Sort

5 mins
A merge sort is a sorting algorithm that uses the divide and conquer strategy to sort a list of elements.

Unstable Sort

2 mins
An unstable sort is a sorting algorithm that does not preserve the relative order of equal elements in the input list.

When to use in-order, pre-order, or post-order traversal?

4 mins
Depth First Search (DFS) is an algorithm for traversing tree or graph data structures, exploring as far as possible along each branch before backtracking. DFS can be performed using in-order, pre-order, or post-order traversal, each suitable for different problems.

Traversing Binary Trees

3 mins
Pre-order traversal visits the current node first, followed by the left and right child nodes, while post-order traversal visits the left and right child nodes first, followed by the current node

Recursion

5 mins
Recursion is a powerful concept that can be used to solve a variety of problems. It is a great example of how a simple idea can lead to a very efficient algorithm. It is also a great example of how a simple idea can be implemented in different ways. The iterative and recursive versions of algorithms are both correct and efficient. The choice between the two depends on the specific problem and the specific requirements.

Trees

3 mins
A tree is a type of data structure that is used to model many different mathematical structures. They are used in many different applications, including file systems and computer generated imagery.

Binary Trees

3 mins
A binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child. This restriction means that a binary tree is a special type of tree, and it is not the same as a general tree.

Binary Search Algorithm

8 mins
Binary search is an efficient array search algorithm. It works by narrowing down the search range by half each time. If you have looked up a word in a physical dictionary, you have already used binary search in real life.