Skip to content

brendanrsmith/data-structures-and-algorithms

Repository files navigation

Data Structures and Algorithms

301 Code Challenges

Here

401 JavaScript Code Challenges

Array Binary Search

Array Shift

FIFO Animal Shelter

LinkedList Zip

Queue with Stacks

Reverse LinkedList

Multi Bracket Validation

Fizz Buzz Tree

Insertion Sort

Merge Sort

Quick Sort

Repeated Word

Left Join

insert(value) - Adds a new node value to the list at the head.

includes(value) - Takes a value, and returns true/false if the value is present in the list.

toString() - Returns a string representing all the values in the linked list in text format.

append(value) - Adds a new node value to the list at the tail.

insertBefore(value, newVal) - which add a new node with the given newValue immediately before the first value node.

insertAfter(value, newVal) - which add a new node with the given newValue immediately after the first value node.

kthFromEnd(k) - which returns a node's value that is k from the end of the linked list.

zipLists(list1, list2) - zips together two linked lists into a new list with alternating nodes from list1 and list2

push(value) - adds a new value to the stack.

pop() - removes and returns the top value on the stack.

peek() - returns the top value on the stack. Does not remove it.

isEmpty() - checks if stack contains any values, returns a boolean.

enqueue(value) - adds a new value to the rear of the queue.

dequeue() - removes and returns the value at the front of the queue.

peek() - returns the value at the front of the queue. Does not remove it from the queue.

isEmpty() - checks if queue contains any values, returns a boolean.

Binary Tree

preOrder() - returns pre ordered tree contents as array

inOrder() - returns in ordered tree contents as array

postOrder() - returns post ordered tree contents as array

findMaximumValue() - returns the maximum value stored in a tree containing Numbers

breadthFirst() - returns breadth-first ordered tree contents as array

Binary Search Tree

add(value) - adds given value as node correctly ordered in BST

contains(value) - returns boolean if given value is present at least once in BST

add(key, value) - takes in both the key and value. This method should hash the key, and add the key and value pair to the table, handling collisions as needed.

get(key) - takes in the key and returns the value from the table.

contains(key) - takes in the key and returns a boolean, indicating if the key exists in the table already.

hash(key): takes in an arbitrary key and returns an index in the collection.

leftJoin(left, right) : takes two hash tables and performs a left-join, returning a new hash table.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages