This repository contains challenges relating to Data-Structures & Algorithms. The challenges were written primarily by Code Fellows and this README will serve as a table of contents to the individual challenges and their appropriate README's as well.
Format:
- Link to code - Link to docs
- reverseArray - Challenge Documentation
- arrayShift - Challenge Documentation
- arrayBinarySearch - Challenge Documentation
- Linked Lists - Challenge Documentation
- llInsertions - Challenge Documentation
- llKthFromEnd - Challenge Documentation
- ll_merge - Challenge Documentation
- Stacks & Queues - Challenge Documentation
- queueWithStacks - Challenge Documentation
- fifo animalShelter - Challenge Documentation
- multiBracketValidation - Challenge Documentation
- Trees - Challenge Documentation
- FizzBuzz - Challenge Documentation
- breadthFirstTraversal - Challenge Documentation
- getMax (Binary tree) - Challenge Documentation
- Graph - Challenge Documentation
- Breadth First Graph - Challenge Documentation
- Get Edge - Challenge Documentation
- Depth First Preorder Traversal - Challenge Documentation
- Hashtable - Challenge Documentation
- Insertion Sort - Challenge Documentation
---
image placeholder
image placeholder
image placeholder
image placeholder
image placeholder
image placeholder
image placeholder
image placeholder
Implement your own Graph. The graph should be represented as an adjacency list, and should include the following methods:
- AddNode()
- Adds a new node to the graph
- Takes in the value of that node
- Returns the added node
- AddEdge()
- Adds a new edge between two nodes in the graph
- Include the ability to have a “weight”
- Takes in the two nodes to be connected by the edge
- Both nodes should already be in the Graph
- GetNodes()
- Returns all of the nodes in the graph as a collection (set, list, or similar)
- GetNeighbors()
- Returns a collection of nodes connected to the given node
- Takes in a given node
- Include the weight of the connection in the returned collection
- Size()
- Returns the total number of nodes in the graph
image placeholder
Extend your graph object with a breadth-first traversal method that accepts a starting node. Without utilizing any of the built-in methods available to your language, return a collection of nodes in the order they were visited. Display the collection.
image placeholder
- A method/function named
add
that takes in both the key and value. This method should hash the key and add the key and value pair to the table. - A method/function named
Find
that takes in the key and returns the value from key/value pair. - A method/function named
contains
that takes in the key and returns if the key exists in the table already. - A method/function named
GetHash
that takes in a key and returns the index in the array the key is stored.
Lab challenge (needs a whiteboard after class)
Sorts an array from left to right iteratively placing each new element into the appropriate index.
At it’s worst, the array is in the reverse order, giving a runtime of O(n^2), but on average it isn't going to be the worst possible runtime so it will still be O(n^2) with any data set. As for space, all this is doing is sorting the same array in place so it takes the same amount of space or O(1)
Write a function that accepts an array of integers, and returns an array sorted by a recursive quickSort algorithm.
QuickSort has an efficiency of O(nLogn). This is because we always are dividing our problem until we reach a simple condition (the base case) then we meet that condition and that allows us to solve the next piece up the stack and that can potentially be a worst case scenario, but it most likely won't have t odo 100% of the work every time.