
Explore sorting algorithms and data structures in JavaScript, from selection and bubble sort with recursion and Big O notation to binary search tree, ADL tree, lists, tries, and hash tables.
Introduce yourself in the Q&A, share where you are from and why you enrolled, to help us tailor a great learning experience.
Install Visual Studio Code by visiting the download page, letting the site detect your OS, and choosing Windows, Mac OS, or Linux. Accept the license and set a destination folder.
Learn how sorting arrays works, compare elements to ensure the output is increasing, and see why sorting data like orders or employee ids is essential for algorithmic problem solving.
Learn selection sort, the simplest sorting algorithm, by finding the smallest element in the unsorted part and swapping it with the first item, moving a wall to grow sorted part.
Identify the smallest element in the unsorted part by comparing with i and j, store the i value, swap with the first unsorted element, and repeat until sorted.
Bubble sort compares adjacent numbers, swaps when out of order, and bubbles the biggest elements toward the end, reducing the array size each pass until sorted.
Demonstrates bubble sort in JavaScript by swapping adjacent elements in an array, using an outer loop to bubble the largest to the end while tracking sorted elements.
Implement the optimized bubble sort that detects when no swaps occur in an iteration and early exits, recognizing the array is already sorted to save time.
Demonstrates a bubble sort optimization that stops when no swaps occur, using a swap flag and debugging steps to verify the array is sorted.
Explore recursion as a powerful problem-solving technique in computer science, where a function calls itself with smaller arguments until an ending condition stops. Learn to implement recursive problems.
Explore the factorial function through iterative and recursive implementations, explain the ending condition and recursive calls, and illustrate how recursion evaluates factorial step by step.
Explore recursion and debugging with a factorial example, using breakpoints and stepping to reveal how recursive calls unfold and how the temp variable stores results.
Master merge sort by understanding recursion that splits an array into halves, then merges sorted halves using two pointers to produce a fully sorted result.
Implement merge sort in JavaScript using slice to partition arrays, and a merge routine with left and right subarrays, indices from and to, and pointers.
Master quicksort by partitioning an array around a pivot, swapping smaller and larger elements to the left and right, then recursively sorting subarrays until fully sorted.
Implement a recursive quicksort in javascript by defining a quicksort function, a partition function, and performing in-place swaps around a pivot to sort subarrays.
Choose the quicksort pivot with median-of-three from the first, middle, and last elements to place the pivot near the middle and improve partition-based recursion.
Explore implementing quicksort with a median-of-three pivot. Build partition logic, swap elements, and test a JavaScript array sorting algorithm.
Learn how time complexity measures an algorithm’s runtime independent of device, by counting primitive operations as a function of input length, with examples from a for loop and common operations.
Discover how Big O notation hides constant factors to compare time complexities, identify constant, linear, and quadratic cases, and analyze worst-case growth with practical examples.
Compare sorting algorithms in JavaScript, examining time complexity, average vs worst case, space usage, and stability, and highlight when merge sort, quicksort, or bubble and selection sorts are preferable.
Compare sorting algorithms implemented in JavaScript, including bubble sort, selection sort, merge sort, and quicksort variants. Measure performance on random arrays and verify sorting to discuss empirical speed differences.
A data structure organizes data to enable efficient access and modification, improving over arrays or lists whose search can be slow, and future lectures show how to boost time efficiency.
Learn what a binary search tree is, with root, leaves, and left and right subtrees. Master insert, search, and delete across leaf, one-child, and two-children cases, and height-based time complexity.
Define a binary search tree in JavaScript with node and root, and implement insert, search, and delete operations.
This lecture explains a delete method for a binary search tree in javascript, covering leaves, single-child nodes, and two-child nodes by using the largest value from the left subtree.
Debug and fix a binary search tree by tracing insert, delete, and search, preventing duplicates, and confirming values are in or not in the tree to ensure delete works.
AVL trees use balance factors and rotations, including left, right, and double rotations, to keep the tree balanced after insertions or deletions, ensuring efficient search and insertion.
Learn how to insert numbers into an AVL tree by following binary tree insertion, compute balance factors along the path, and perform rotations (left, right, or left-right) to maintain balance.
Delete in an AVL tree mirrors binary search tree deletion; update balance factors to the root and replace deleted node with largest number from the left subtree, using rotations.
We start implementing the AVL tree by defining a node with value, parent, left, and right, then compute the balance factor using a recursive height function.
This lecture builds an avl tree in javascript, implementing insert, search, and delete operations. It demonstrates rebalancing after inserts to maintain balance and compares traversal to a binary search tree.
Implement delete node in an AVL tree by handling leaf, one-child, and two-child cases, using a successor from the left subtree, updating parent pointers, and rebalance from the affected node.
Find and return the largest node from the left subtree and rebalance the AVL tree with left, right, and double rotations.
debugs an AVL tree deletion when removing a node with two children, fixes a conditional that checked the wrong subtree, and confirms tests pass after the correction.
This lecture explains a linked list, where each node holds a value and a next pointer, with head insertion in constant time and search and deletion via traversal and rewiring.
Define a linked list in JavaScript by creating a node with a value and next, building a list with a root, and implementing insert, search, and delete operations.
Explore tries as a tree-like data structure with a root and nodes connected by child mappings to store words by prefixes, and implement add, search, and delete through word indicators.
Learn to implement a trie in JavaScript by building a node with a map and word flag, and adding insert, search, and delete operations that track paths for efficient removal.
Discover hash tables and hash functions that map keys to array indices for fast insert, search, and delete. Learn collision handling with linear probing and linked lists, plus hash functions.
Create a hash table with an array of lists, and implement insert, search, and delete using a hash function and a Jenkins hash variant.
This course is designed to help you understand sorting algorithms and data structures. In my experience most people focus on the programming language, but people often forget about algorithms.
Algorithms are definitely more important than a programming language, you can learn a programming language in about week, but the problem-solving ability is much harder to learn. But the benefits are worth it.
When you get to interview mostly they care about your problem-solving abilities, algorithms and data structures.
To get your dream job, you need to know how to solve whatever problem they have. In this course, you will learn how to do that.
Also, I believe that nobody has time for long and boring lectures, so in this class, I try to explain the important things in a fast and engaging way, so I won't bore you to death.
We start off with Sorting algorithms:
- Selection Sort
- Bubble Sort
First there is the explenation lecture where you learn the idea behind an algorithm, then there is the implementation lecture, where we implement the algorithm in Javascript.
Then I show you how Recursion works, once again I try to explain what recursion means, then we implement some recursion algorithms and we use debugger to see how computer evaluates recursive functions.
Then we move on to recursive Sorting Algorithms
- Merge sort
- Quick sort
These algorithms are most commonly used. With each algorithm I explain the idea, then we implement the algorithm.
Once you learn sorting algorithms, we move on to Time Complexity:
- What is time Complexity
- Big O notation
I explain what is time complexity and why we need it, also, I will show you how to compare sorting algorithms, so that we can see which one is the "best".
In this section you also find an article with a lot of problems, where you can train your problem solving skills.
After that we take a look at Data Structures, I choose In my opinion the best dat structures for you to learn the important concepts.
We start of with Tree Data Structures:
- Binary Search Tree
- AVL tree
You learn how these works and also how to implement them.
Then we take a look at Linked List, Stack, Tries and Hash Tables. Once again we implement all of these in Javascript.
I believe that learning and understanding these concepts will help you solve problems more efficiently.