Working on creating the basic repo needed for new grads in CS. You might not be asked to implement these functions but you should know them to solve a problem on an interview.
-
Binary Search Trees
- insert (putting a node into your tree at the correct position)
- delete (deleting a node and than repositioning the tree)
- inOrder (traversing the binary through recursion and iteratively)
- preOrder (traversing the binary through recursion and iteratively)
- postOrder (traversing the binary through recursion)
- getHeightOfNode (returns height of BST)
- contains (checks whether a value exist in the tree recursion and iteratively)
- levelOrderTraversal (prints nodes from top to bottom)
- reverseLevelOrderTraversal (prints nodes from bottom to top)
- printAtGivenLevel (prints nodes at given level)
-
LinkedList (WIP)
- Singly LinkedList
- insertAt
- insertAtEnd
- size
- deleteAt
- get
- reverse (linkedlist reverse inplace)
- Singly LinkedList
-
Stack (Building a stack using arraylist)
-
Stack (Building a stack using linkedlist)
More to come :)
Done in java. I'm still working on adding some edge cases but for the most part these functions will work for most cases.
Start by picking a data structure. The IDE I used for this was Eclipse (Oxygen.3a Release (4.7.3a). Once you are able import the files and get it to run try debugging one function call at a time to understand whats working under the hood. http://people.cs.uchicago.edu/~kaharris/10200/tutorials/eclipse/import.html