
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Overview of the class
Learn how arrays store multiple numbers, index from zero, and traverse with for loops in Python, then implement in-place running sums and array reversal using two pointers.
Learn array partitioning with a pivot, placing it at its final position so left of pivot are ≤ pivot and right are ≥ pivot, using a two-pointer swap.
Demonstrate array partitioning in Python using a partition function with two pointers and a first-element pivot to separate values into left and right partitions, ending with a final swap.
Explore binary search on a sorted array to locate x using two pointers and a left-biased midpoint, halving the search space and returning the index or -1 if not found.
Learn binary search in Python on a sorted array, using mid and start/end pointers to locate a target or return -1, with examples like x=7 at index 4.
All aspiring programmers - this class will introduce you to the inner working of some of the most basic algorithms. Developing an algorithm from scratch reveals a whole lot of internal details that are otherwise not obvious. Programming is a lot about being able to handle these details. This class deals with simple and well-known algorithms that work on an array of numbers. The aim is to clearly visualize what goes on under the hood for these most basic algorithms. Knowing these details is a must to become a confident programmer.
In order to start with this course, you need to have a Python programming environment ready. I suggest Anaconda with Pycharm. You may also do with Jupyter notebook. First it introduces a very basic data structure called Array. Then you will learn 2 most used algorithms namely Partitioning and Binary Search. You will be able to know exact steps of these algorithms and visualize the inner working. The implementation of these algorithms is given and you are encouraged to test them in your own Python programming environment.
At the end, you are invited to implement another very well-known algorithm called QuickSort. This is your project after completing the lectures. Good luck!