
Here is the source code for what is introduced in this course.
Explore how algorithms solve problems with efficient, fast performance, foundational to programming, and learn data structures that store and retrieve data effectively, including linked lists, hash tables, stacks, and queues.
Learn how cocktail sort, an improved bubble sort, uses bidirectional passes to move the largest element to the end, and see a Python implementation with a swapped flag.
Explains comb sort, a bubble-sort variant using a shrinking gap and a swap flag, with a Python implementation that reduces the gap by 1.3 until one.
Demonstrate selection sort with a Python implementation. Learn to find the minimum in the unsorted portion and swap it into place using outer and inner loops.
Explore gnome sort, a swap-based sorting algorithm similar to bubble sort and insertion, and implement it in Python with a step-by-step example and interview-ready coding practice.
Practice counting sort by tallying counts up to the maximum value and building a cumulative counts array, then placing elements from the back to produce a sorted list in Python.
Explore radix sort, which uses counting sort as a subroutine to sort numbers by each digit (ones, tens, hundreds) in a stable pass.
Explore quicksort through a detailed partitioning process using a pivot, arranging numbers to left and right, then recursively sorting subarrays; includes Python code and interview relevance.
Learn merge sort by splitting a list into left and right halves, recursively sorting each half, and merging to ascending order, with a Python implementation using left, right, and indices.
Explore Tim sort, an efficient sorting algorithm created by Tim Peters in 2002, built into Python's standard library. It blends merge sort and insertion sort to reorder lists efficiently.
Learn how binary search quickly finds a target in a sorted list by halving the search range using left, right, and mid indices, with both iterative and recursive Python implementations.
Explore linked lists and nodes, using next pointers to link data in Python. Implement append, insert, print, and remove operations to manage and trace the links in the list.
Demonstrates reversing a simple linked list in python using both iterative and recursive approaches, updating node links and head, and validating with a sample zero, one, two, three list.
Rearrange a linked list by reversing every streak of more than one even number, using a recursive reverse even method and careful head and previous node handling.
Master reversing a doubly linked list in Python using iterative and recursive methods. Update the previous, current, and next pointers and set the new head.
Sorts a doubly linked list by swapping node data through a while-loop pass, using bubble sort to turn 1 5 2 9 into 1 2 5 9.
Learn to find pairs that sum to a target using a set-based approach, plus a second problem where the remaining numbers also sum to that target, with Python examples.
Explore the stack data structure by implementing a stack class with push and pop operations on a list, illustrating adding and removing the most recent value.
Master validating JSON format by matching opening and closing brackets with a stack, producing true or false via a Python-based algorithm.
Explore queue concepts by enqueuing at the back and dequeuing from the front, using Python lists or the collections deque for efficient front removals and optional stack behavior.
Explore reversing a queue without using the built-in method by popping values into a new queue with a while loop, then returning and printing the reversed order.
Explore the binary search tree data structure, observe how values branch to the left and right to maintain order, and implement search in code.
Learn to insert nodes into a binary search tree with a node class, left and right children, and a recursive insert function; visualize the structure with examples.
Explore in order traversal of a binary search tree using recursion, printing nodes left-root-right, and implement a recursive search function to locate values such as three, one, or six.
Learn to remove a value from a binary search tree by locating the node, handling cases, and replacing with the smallest right-subtree value, verified by printing the nodes in order.
Transform binary search tree operations into a Python class, implementing insert, order, search, and remove as class methods with inner functions and self-references.
Explore min heaps and max heaps, build a binary heap from inputs, and apply swaps to maintain heap order, with pop removing the smallest value.
Implement a min-heap in python by building a minyip class with push and pop, heapify up and down, and index helpers for parent, left, and right.
Learn to use Python's heapq, with heapify and heappush and heappop, to rank data and extract N values. Count word frequencies with dict or Counter, and use a min-heap of negative counts.
practice solving many coding questions to spot patterns, pause to attempt answers, and memorize solutions when needed; the next lecture introduces coding questions.
Identify symmetric pairs in a list of two-element tuples using a hash table, yielding and outputting reverse pairs like (5,3) and (7,4).
Count the occurrences of each integer in two lists X and Y, then eliminate the smaller-count value when it appears in both lists, using dictionaries or a counter.
"Why do we need to know algorithm?"
For those who are already working in the IT field, you may wonder why we need to know algorithm since you don't use it in your day to day tasks. Not everyone working in the IT field uses algorithms, but let's take a moment to think about why candidates applying for GAFA (Aka Google, Apple, Facebook, Amazon) are always asked interview questions regarding data structures and algorithms.
What type of engineer do you want to be?
As you may know, Google's search function and Tesla's automated driving require top quality performance and that wouldn't be possible without exceptional algorithm efficiency. Therefore, it's important for programmers to have the ability to write codes that can perform well. Of course, if you just want to create a small scale web page using a simple web framework, you won't need to know about algorithm. But services that are popular in our modern society today will face issues with scalability. At the initial stage of creating services, whether the algorithm runs properly or not may be main issue, but as time progresses, the amount of data increases and programmers will have to focus on how to process the data received in a timely manner. That's when the programmer's skills and knowledge are really put to the test.
If you are considering working as an engineer in the Silicon Valley, in most cases (or perhaps all cases), you'll encounter a coding interview portion and without passing this portion of the interview, you won't be hired. Your soft skills may be looked at by the interviewer, but without a solid background and knowledge of algorithm, you won't be able to get the position.
Why should I take this course?
In the first half of this course, we'll be covering the basics of algorithms and data structures using Python. In the latter half, we'll be covering coding questions you may be asked during an actual interview. If you're familiar with the basics of Python, then you'll be able to understand the algorithms and data structures introduced in this course. By the end of this course, we hope you feel more confident and feel prepared to answer coding interview questions.
Happy learning!