
Explore fundamental data structures in JavaScript, including arrays, linked lists, trees, stacks, queues, graphs, and hash maps, and learn recursion and Big O time and space.
Explore the difference between arrays and lists in JavaScript, noting fixed-size arrays and lists, and show how a list is built from a fixed-size array using get and add methods.
Explore fixed size, zero based arrays and for loops to iterate data, compute averages, and track minimum and maximum temperatures by sampling the first element.
Explore pairwise array comparisons by evaluating adjacent elements with absolute deltas, and learn safe for loop bounds to avoid end-of-array errors, using i and i+1 or i and i-1.
Write a JavaScript function that takes an array and returns the sum of absolute differences between consecutive elements, handling empty and single-element cases. Ensure loop bounds to avoid undefined values.
Implement a contains function using the mousetraps technique to search an array, returning true when found and handling empty array; implement is sorted with pairwise comparisons to verify ascending order.
Rewrite the is sorted function to recognize arrays that are sorted in ascending or descending order, including empty, single-element, and two-element arrays, and identify unsorted cases like 1 5 2.
determine if an array is sorted by scanning with a for loop and tracking is ascending and is descending, using a mouse-trap analogy to avoid resetting once violated.
Master two-dimensional arrays by building a four by four grid and accessing elements as a[row][col]. Understand top-left 0 0 coordinates and why row and column indexing matters.
Create a times table from a 2d array with nested loops, iterating the outer rows then the inner columns, and print lines to preserve the table structure.
Explore two-dimensional array traversal by finding the largest product of adjacent numbers (left, right, up, down; no diagonals) in a 4x4 grid, with boundary checks and a get cell helper.
implement a minesweeper-style function in JavaScript that accepts a minefield as a 2d array and prints a grid of numbers showing how many adjacent bombs each cell touches, including diagonals.
Iterate through the two-dimensional minefield, use a boundary-checked get cell helper to count neighboring bombs in eight directions, build each line, and print the Minesweeper grid.
Learn to implement tally sort in JavaScript by counting occurrences of integers within a min-max range and reconstructing a sorted array.
Explore a tally sort implementation in JavaScript that builds a tally array from the maximum value, counts occurrences, and outputs a sorted result array of integers. Works for integers only.
Explore the difference between arrays and lists in JavaScript, showing how a list builds on a fixed-size array with push, insert, and remove operations to adapt size.
Learn to build a simple list class in JavaScript using class syntax, a constructor, push and toString methods, and a grow function to auto-resize the internal data array.
Learn how to remove an element from an array by shifting items left from the index and decrementing size, using a loop that overwrites positions and scribbles out stale values.
Implement a list insertion in a JavaScript dynamic array by adding at a specific index, shifting elements from the end, and growing capacity as needed.
Implement a contains method on a list class using for loops and array accesses, and verify membership before and after removing the last item, yielding true or false.
Implement a JavaScript list contains method using a for loop with i from zero to size, returning true when data at i equals value, otherwise returning false after examining array.
See how the list class exposes get and set methods to safely access data. The methods enforce index bounds, returning the value or null and preventing out-of-range edits.
Implement a can cat method on the list class to concatenate two lists into a new list that contains the values 5 8 12 13 19 20 23 24 25.
Implement the can cat list concat method in JavaScript, returning a new list by iterating and pushing elements, and compare arrays with the list abstraction.
Master big o notation to evaluate time and space complexity of data structures, especially arrays, noting worst-case O(n) search, insert, delete, and constant time O(1) access.
Explore big O concepts, including constant time, linear time, and n squared time, using a simple array list to demonstrate append, remove at index, and contains duplicates.
This lecture uses a measure time utility to compare functions across array sizes, illustrating constant time for size queries, linear time for removal, and n squared time for contains duplicates.
Explain how a tally sort algorithm counts occurrences, builds a new array from those counts, and reduces time complexity to O(n) by dropping constants.
Explore big O notation by analyzing two sample functions to determine their worst-case time complexity.
analyze loop performance and early exit optimizations in JavaScript to understand big O implications for nested loops and half-length palindrome checks, emphasizing ignoring constants in big O notation.
Explore singly linked lists and compare them to arrays, highlighting constant time insertion and deletion, node references, and how Big O guides choosing data structures.
Create and wire a linked list in JavaScript using a list node class, then traverse with a current pointer to print values and sum the data.
Practice linked list manipulation in JavaScript through five challenges that build an empty list to 1 → 2 → 3, including front insertion, mid insertions, and tail deletion.
Build and manipulate linked lists in JavaScript by creating nodes, linking them with next pointers, and inserting at the front or end, removing middle elements in O(1).
Implement a list class in JavaScript by defining a node class with data and next, and a root-based list class, adding methods like prepend, toString, length, and empty.
Get a value from a linked list by index with a get at index, counting nodes from root to target and returning null for indices, highlighting linear time versus arrays.
Remove at index in a linked list by handling front, middle, and end cases, updating pointers to skip the target node; note O(1) operations with a node reference, otherwise O(n).
Learn to insert at a specific index in a linked list by updating next pointers, handling the front case, and updating the size; implement append via add at index.
Compare array lists and linked lists, showing array lists store data contiguously for read and write, while linked lists allow inserts and removals with O(1) updates and avoid O(n) shifts.
Learn to prefer manipulating the dot next references in a linked list, because data is large and overwriting it is costly and can create cycles if next pointers aren’t updated.
Explore the stack data structure, its push and pop operations, and top access in constant time, while using it for undo redo, parentheses matching, and function-call tracking.
Explore stack implementations using arrays with a size tracker and linked lists, showing push and pop operations at the top to achieve constant-time performance.
Build a stack from a linked list in JavaScript by implementing a stack node, top, and push, pop, and peak methods; see how pushes and pops yield reverse order.
Build a stack from an array and compare it to a linked list, using push, pop, and peek at the end of the array, illustrating encapsulation and a shared interface.
Implement a JavaScript isBalanced function that scans a string, pushes opening symbols on a stack, peeks to match closers, and returns true when the stack is empty.
Iterate each character, push opening parentheses on a stack, and pop on a matching closing parenthesis; return false if unmatched, and ensure the stack is empty at the end.
Apply a stack-based approach to check balanced parentheses, brackets, and curly braces in JavaScript, ignoring non-opening characters, and verify matches for each type.
Explore a stack-based solution to balancing parentheses, brackets, and braces in JavaScript by comparing opening and closing characters, using push and pop, and validating matches.
Condense a random sequence by removing adjacent identical numbers and avoiding new matches. Implement a random sequence generator (numbers 1–10) and a condense function that cancels pairs.
Master condensing an inefficient sequence in JavaScript by comparing adjacent numbers using arrays or strings, then apply a stack-based optimization to collapse duplicates and improve performance.
This lecture demonstrates condense using two stacks to remove matching pairs from a sequence, achieving an efficient O(n) solution with push and pop, and contrasts it with an O(n^2) approach.
Explore the queue data structure, a first in, first out system with enqueue and dequeue operations, implemented via a linked list with front and tail for constant time.
Implement a queue in JavaScript using a linked list with a node class, tracking front and tail, enqueuing at the end and dequeuing from the front, while handling empty cases.
Explore the Josephus problem with a queue-based approach by simulating an array of people in a circle, counting to n, and eliminating every nth choice until one winner remains.
Demonstrate solving the Josephus problem with a queue by enqueuing choices, counting with modulus, and requeuing non-eliminated items.
Demonstrates the sieve of Eratosthenes to generate primes up to a limit using two queues. Implements a primes-up-to-end function that returns primes from two up to end.
Apply the sieve of Eratosthenes with two queues to generate primes up to n, swapping queues and filtering numbers by divisibility to build the primes list.
Explore how native JavaScript arrays can act as queues using push and unshift/shift, reveal that big O time complexity varies by engine, and roll your own queue for predictable performance.
Explore recursion as a function that calls itself, including the Droste effect, illustrating counting down and recursively iterating an array, with base and recursive cases.
Explore the classic recursive Fibonacci function, define base cases fib(1)=1 and fib(2)=1, and derive fib(n)=fib(n-1)+fib(n-2) through a clear recursive approach.
Build a JavaScript palindrome checker using a recursive function that keeps a string, start and end indices, returns true for strings under two, false if ends differ, and recurses inward.
Define a palindrome checker function that uses a start and end index with base cases for short strings and mismatched ends, and recursively narrows inward until all letters match.
Master how recursion checks palindromes in a string by comparing start and end characters, handling base cases, and returning results through recursive calls.
Enhance the palindrome solution by ignoring capitalization and punctuation, using a recursive two-pointer approach with an alphabet check to skip non-letters.
Explore trees as a recursive, branching data structure with a root, left and right nodes. Compare to linked lists, learn iterating trees, and study binary trees and their advantages.
Build a binary tree with a root and left/right nodes, then use a public collect method and a private recursive helper to visit every node.
Practice recursively traversing a tree to sum all node data values using a public-private function pair, without converting to arrays, and returning zero when the tree is empty.
Sum all values in a binary tree in JavaScript by returning 0 for null nodes and adding node.data with left and right sums, then preview a contains method.
Develop a contains method for a tree in JavaScript by writing a function that takes a value and returns true if the value exists in the tree, else false.
Implement a binary tree contains function that traverses left and right, returns true when a node matches the value, or false if null; illustrated with 44 found, 100 not found.
Explore implementing two tree utilities in JavaScript: a size function that counts all nodes and a leaves function that counts leaf nodes, with a hands-on example.
Learn to compute the size and leaves of a binary tree and determine its height using recursive traversal in JavaScript.
Explore recursive methods to compute a tree's height and extract min and max values, implementing three functions: min, max, and height, with empty tree height as zero.
Learn to compute the minimum and maximum height of a tree in JavaScript through recursion, comparing left and right subtrees and returning the smallest or largest value.
Explore binary search trees, where left values are smaller and right values are larger; implement insert and contains and grasp why search runs in O(log n).
Build a binary search tree in JavaScript by implementing a binary tree class with a root, an add method, and recursive left-right traversal to insert values in order.
Learn to implement an efficient contains method for a binary search tree in JavaScript, leveraging BST structure to achieve logarithmic time and proper directional traversal.
Implement a binary search tree contains function with base cases and left-right traversal based on value comparisons to achieve efficient search.
Inserting nodes in random order keeps a binary search tree balanced, while sorted insertion creates an unbalanced tree like a linked list with O(n) time. Self-balancing trees maintain O(log n).
Build a MorseCodeTree class in JavaScript with a manual constructor and decode method to convert sequences of dots and dashes into letters like sos and cat.
Build a Morse code tree by manually creating Morse nodes, setting the root and dash/dot paths, and implement a decoding routine to translate messages like 'man'.
Explore hash maps, hash tables, and dictionaries, linking keys to values with a hash function that computes an index in buckets for constant average time. Understand collisions and handling ideas.
Explore how a hash function maps keys to buckets for constant time lookups and handle collisions with linear probing, storing key-value pairs and supporting get, insert, and delete, adjacency lists.
Master hash maps with collision handling by chaining through linked lists in buckets. Hash a key to a bucket and traverse list to insert, retrieve, or update, giving O(1) lookups.
Master collision handling in JavaScript by implementing a hash map with buckets and a linked list, including insertion, retrieval, and the impact of load factor and hash functions.
If you want to be a good programmer or want to build good software, then the knowledge of data structures and their role in software development becomes essential. Data Structure is basically a process for collecting and organizing the data in the best way possible for performing operations efficiently. They form the fundamentals of computer science. With a good understanding of data structure, we master the way of organizing and storing data for a specific purpose. This course is aimed for helping you understand the core concepts behind these data structures and how they are used to build algorithms that solve business problems.
Why this course is important?
This course gives insight into the data science and algorithms in JavaScript covering all the essential topics. It unfolds with the basic introduction, then covers all the aspects of arrays such as arrays vs lists, common array iterations, array functions and others. Following this, lists, big o time space asymptomatic analysis, linked lists and stacks are also covered in details. Lastly, introduction to queues, its implementation, various aspects of recursion, trees, hash maps and graphs are also covered for the complete understanding of data science and algorithms.
This course includes-
1. Introduction to the data structure
2. Arrays, common array comparisons, array functions, searching arrays, 2d arrays, iterating over 2d arrays, Minesweeper challenge, minesweeper solution and others
3. Lists, implementing list push, implementing list remove and so on
4. Big o time space asymptomatic analysis- its introduction, big o of n squared, no constants, big o challenge and big o solution
5. Linked lists, coding linked lists, linked list class, remove at index and add at index
6. Stacks- introduction, implementation, stack out of linked list, stack out of array, condense challenge and others
7. Queues, recursion, trees, hash maps, graphs and much more important things!
Get started with this course now to learn data structures and algorithms for acing any job interview or building better software!