Jun 29, 2022Data Structures: Priority QueueIn the last post, we discussed creating a max binary heap. Today we will make a priority queue which is essentially a min binary heap. In a regular queue, we operate by using FIFO (first in first out). An example of this is people waiting in line to check out…Priority Queue3 min readPriority Queue3 min read
Jun 29, 2022Data Structures: Binary HeapA heap is a specific type of tree. The general structure of a binary heap is similar to our binary tree, but a few new rules apply. We will discuss max-heaps, min-heaps, and priority queues. A max binary heap (first photo) is a tree where the parent node is always…Binary Heap4 min readBinary Heap4 min read
Jun 27, 2022Data Structures: Binary tree traversal, Depth-First SearchOn the last post we talked about performing breadth-first searches with the help of a queue. Now we are moving onto depth-first searches. We have a few options when performing a depth-first search: in-order, pre-order, and post-order. The code for all 3 of these options is nearly the same and…Data Structure Algorithm3 min readData Structure Algorithm3 min read
Jun 27, 2022Data Structures: Binary tree traversal, Breadth-First SearchIn the previous post, we utilized a ‘contains’ method on our binary tree class. What if we would like to know all of the nodes contained in our tree? We need to create a new method for this. However, what order would we like the values to be in? …Data Structures2 min readData Structures2 min read
Jun 27, 2022Data Structures: Binary TreeAnytime one of us interacts with a webpage we are relying on a binary tree. The DOM is one of the better known examples of a use case for binary trees. Trees are made up of a root, parent nodes, child nodes, and leaves. Each node has a value, and…Data Structures4 min readData Structures4 min read
Jun 22, 2022Data Structures: QueueA queue is very similar to a stack. It operates on a different principle FIFO (first in first out). A queue can be visualized by thinking of people waiting in line to be helped. Those that are in line first are helped sooner. A queue can once again be created…Data Structures2 min readData Structures2 min read
Jun 22, 2022Data Structures: StackThe next type of data structure that we are going to discuss is called a stack. It works on the principle of LIFO (last in first out). One way we have all interacted with a stack is the call stack. You can think of a call stack as a stack…Data Structures2 min readData Structures2 min read
Jun 22, 2022Data Structures: Doubly Linked ListIn the last article we talked about singly-linked lists, today our fun is about to double with doubly-linked lists! Doubly linked lists are quite similar to a singly linked list except each node has a previous property as well. The downsides of a singly linked list were a linear search…Data Structures4 min readData Structures4 min read
Jun 22, 2022Data Structures: Singly Linked ListIn Javascript, there are data structures natively present such as arrays and objects. There are pros and cons to using these native data structures and certain scenarios require a different structure to be used. For example, if we need a structure that is ordered but needs constant time removal from…Data Structures5 min readData Structures5 min read
Jun 15, 2022Algorithms: Radix SortThe next sorting algorithm is far more interesting than the previous algorithms we have discussed. Up until this point, we have been using comparison algorithms. These algorithms worked by comparing two values. Radix sort works in a completely different way. Radix sort works by placing numbers in 1 of 10…Algorithms3 min readAlgorithms3 min read