Algorithms are the basic construction of the computer programs that you are writing every day. They take language syntax and the machine uses that information to carry out our commands. While "everything is an algorithm!" is basically a true statement, we also have quite a bit of thought and effort put into defining formal algorithms. Understanding these formal algorithms helps you as a developer so that you won't need to re-invent the wheel every time you sit down to solve a problem.
They also come up quite a bit as "white board problems" in programming job interviews, so understanding algorithms is a big win for you as a coder.
The FizzBuzz problem is commonly presented as the lowest level of comprehension required to illustrate adequacy in computer programming.
In this lesson you learn about the problem as well as its solution in TypeScript. We will also cover some tricks on approaching the problem and coding interview questions in general.
In this lesson we cover all the details of how to sort a list of items using TypeScript. There are a few things that will catch beginner developers off guard, such as the
.sort method mutating your array, and how the
.sort method doesn’t sort numbers how you’d expect. In this lesson we’ll be going over these gotcha’s and how to work around them.
We’ll also present a few tricks to make your sort logic more readable and maintainable using TypeScript.
We look at the default
The anagram test is commonly used to demonstrate how an naive implementation can perform significant order of magnitudes slower than an efficient one. We’ll also briefly go over why each implementation is not as efficient as you could make it.
A word is an anagram of another if you can rearrange its characters to produce the second word. Here we’ll write multiple increasingly more efficient functions that given two strings determines if they are anagrams of each other.
We also discuss a more complex algorithmic challenge of writing a function to check if any permutation of a given string is a palindrome.
Quicksort (also called partition sort and pivot sort) is arguably the most used sorting algorithm. It is the one commonly implemented internally in language runtimes.
Insertion sort is a very intuitive algorithm as humans use this pattern naturally when sorting cards in our hands.
Binary search is a very fundamental algorithm in Computer Science. It powers BSTs (binary search trees) which form the basis of modern databases and immutable data structures. Binary search works very much the way humans intuitively search for a name in a yellow pages directory (if you have ever seen one) or the dictionary.