
After this lesson, you will develop a vey clear understanding of bit and byte, including what they are and what they can store.
Learn how bits become bytes and map to characters through ascii's 7-bit 128-character set, unicode, and utf-8/utf-16, with historical Chinese encoding efforts.
Explore how a memory device between the hard disk and the CPO speeds program loading, and how dynamic random access memory uses byte addressing with memory addresses.
Explain how bit width governs memory addressing, from binary digits to hexadecimal notation, and compare 32-bit and 64-bit limits on addressable memory and memory space.
Compare sorting algorithms by stability and workload to balance time and space. Use big o notation to quantify work, focusing on comparisons, swaps, and extra memory.
Explore linear data structures such as arrays and linked lists, compare continuous memory locations with non-continuous storage, and analyze access, insert, and delete time complexities.
Explore non-linear data structures, including binary trees, heaps, and BSTs, learning how root, leaves, depth, height, and complete versus full trees shape storage.
Explore how a binary min-heap is realized in JavaScript by inserting a new element and percolating it up using the parent index formula, floor((childIndex - 1) / 2), so the root remains the smallest.
In JavaScript, convert an ascending array into a binary max heap by building a max heap, pushing elements, and sifting up with parent swaps, enabling the heap sort algorithm.
Explore how binary heaps enable heap sort, using a max heap for descending order and a min heap for ascending order with O(log n) time and O(1) space.
We demonstrate heap sort by converting the unsorted array to a max heap, removing the root with shift, and rebuilding the heap until the array sorts in descending order.
Identify the most and least frequent words in a string by iterating over a word-count object, tracking max and min values, and collecting all words with those frequencies into lists.
Learn bubble sorting by moving largest element to the end of an array, performing swaps, and counting comparisons. Discover how this method sorts data in ascending and descending with JavaScript.
Demonstrates bubble sort in JavaScript by comparing neighboring elements, swapping when needed, and using the length property in a for loop to move the largest or smallest to the end.
Learn how to move the smallest element to the beginning by iterating the array backwards, swapping the current element with the previous one, and adjusting the loop initialization and condition.
Sort an array in ascending order using bubble sort, iterating and swapping adjacent elements to move the largest values to the end, with outer and inner loops guiding repeated passes.
Improve program efficiency by ending the outer loop early when no elements move, using a sorted flag to halt loops while converting ascending to descending.
Improve the inner for loop efficiency by stopping early, reducing comparisons as outer loops progressively place the smallest elements at the end of the array.
Use the right sorting border to stop the inner loop early, tracking the last exchange index to update the right sorting border and avoid unnecessary comparisons.
Iterate the array backwards to build the sorted section at the start, using a left sort border to avoid unnecessary comparisons and sort in descending order.
Cocktail sorting alternates forward and backward passes to move the largest and smallest elements, reducing loops compared with bubble sort and achieving pendulum-like efficiency.
Improve the cocktail sorting algorithm by introducing left and right sort borders and last exchange index, reducing unnecessary comparisons by sorting the ends first and shrinking the unsorted middle.
Explore how the quick sort algorithm uses a random pivot and partitioning to divide an array into left and right sections, applying divide-and-conquer to reach a sorted result.
Explore how quick sort uses recursion in JavaScript, defining a quickSort function, selecting a middle pivot, and partitioning into left and right sections, with a review of concatenate and slice.
Learn how counting sort uses array indices as keys to sort positive integers without comparisons, building a queue from the input and producing ascending and descending orders.
Learn how to handle duplicated elements by using a Q array to count index usage, check for undefined values, and build ascending and descending arrays.
Improve efficiency in counting sort by narrowing the range to the unsorted array's minimum and maximum, and iterating only over the effective range to sort in ascending or descending order.
Improve program efficiency by shrinking the Q array to the effective range, subtracting the minimum value to offset indices with a proxy element, and restoring original values after sorting.
Learn insertion sort, a simple sorting algorithm that builds a sorted left section by inserting each new element into its correct place, with a seven-element array and JavaScript demonstration.
Demonstrate insertion sort by implementing an insert sort function, iterating through an array with outer and inner loops to swap elements until the sorted section is ascending and return array.
Learn bucket sort by setting buckets, distributing elements evenly using the smallest value and bucket size, keeping each bucket ordered, and concatenating them into a sorted array.
Demonstrate bucket sort in JavaScript by finding max and min, creating six buckets, populating them with elements, and concatenating buckets into a sorted ascending array.
Learn how selection sort, an unstable algorithm based on swaps, finds the smallest element by tracking its value or index, then swaps it into the array's beginning and repeats.
Demonstrate selection sort in JavaScript by using an outer and inner loop, tracking a min index, and swapping to place the smallest element in ascending order.
This is a data structure and algorithm crash course for JavaScript developers.
You will learn linear and non-linear data structures and eight sorting algorithms. You will also learn the big O notation so that you can pick the best algorithm for your program.
At the beginning of this course, you will learn basic computing knowledge like bit, byte, memory address, byte addressing, etc.