Types of Algorithm Part 2

Welcome back to Part 2 of "Types of Algorithms." In Part 1, we introduced and thoroughly explained the four essential algorithms. In this second installment, we will explore the sub-principles of each algorithm classification to gain a deeper understanding of how computer programming operates, performs calculations, retrieves information, and powers the systems we utilize every day.

Here are the four categories of algorithms with their corresponding functioning sub-principles:

1. Brute Force Algorithms

Linear Search

A simple algorithm to find a specific value in an unordered list. It checks each item in a list until a match is found or the list ends.

Bubble Sort

A basic sorting algorithm that repeatedly swaps adjacent elements until the list is ordered.

2. Divide and Conquer Algorithms

Merge Sort

Splitting the array into halves until each subarray contains a single element, and then merging these subarrays in a sorted sequence.

Quick Sort

Selects an element to serve as a pivot and organizes the given array around this chosen pivot, positioning it correctly within the sorted array.

Binary Search

Divides a sorted array into two halves to effectively locate the target element.

3. Greedy Algorithms

Huffman Coding

A data compression algorithm uses variable-length codes to reduce code length by assigning shorter codes to frequently used characters and longer codes to less common ones.

Dijkstra’s Algorithm

Finds the shortest path from a source node to all other nodes in a weighted graph.

4.Dynamic Programming (DP) Algorithms

Longest Common Subsequence (LCS)

Determine the length of the longest common subsequence between two sequences, maintaining relative order without requiring contiguity.

Next
Next

Types of Algorithms Part 1