2.9 KiB
title
| title |
|---|
| Algorithms |
Algorithms
In computer science, an algorithm is an unambiguous specification of how to solve a class of problems. Algorithms can perform calculation, data processing and automated reasoning tasks.
An algorithm is an effective method that can be expressed within a finite amount of space and time and in a well-defined formal language for calculating a function. Starting from an initial state and initial input (perhaps empty), the instructions describe a computation that, when executed, proceeds through a finite number of well-defined successive states, eventually producing "output" and terminating at a final ending state. The transition from one state to the next is not necessarily deterministic; some algorithms, known as randomized algorithms, incorporate random input.
There are certain requirements that an algorithm must abide by:
- Definiteness: Each step in the process is precisely stated
- Effective Computability: Each step in the process can be carried out by a computer.
- Finiteness: The program will eventually successfully terminate.
Some common types of algorithms include sorting algorithms, search algorithms, and compression algorithms. Classes of algorithms include Graph, Dynamic Programming, Sorting, Searching, Strings, Math, Computational Geometry, Optimization, Miscellaneous. Although technically not a class of algorithms, Data Structures is often grouped with them.
Efficiency
Algorithms are most commonly judged by their efficiency, the amount of computing resources they require to complete their task.
Sorting Algorithms
Sorting algorithms comes in various flavors depending on your necessity. Some, very common and widely used are:
Quick Sort
There is no sorting discussion which can finish without quick sort. Basic idea is in link below. Quick Sort
freeCodeCamp's curriculum heavily emphasizes creating algorithms. This is because learning algorithms is a good way to practice programming skills. Interviewers most commonly test candidates on algorithms during developer job interviews.
Further Resources
Intro to Algorithms | Crash Course: Computer Science
This video gives an accessible and lively introduction to algorithms focusing on sorting and graph search algorithms.
What is an Algorithm and Why Should you Care? | Khan Academy
This video introduces algorithms and briefly discusses some high profile uses of them.
15 Sorting Algorithms in 6 Minutes | Timo Bingmann
This video visually demonstrates some popular sorting algorithms that are commonly taught in programming and Computer Science courses.
This is also a really good open source project that helps you visualize algorithms.