Skip to content

Hafeez-Khan/Data-Structure

Repository files navigation

Description

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.

What to expect

  • 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)
  • Stack (Building a stack using arraylist)

  • Stack (Building a stack using linkedlist)

More to come :)

Code

Done in java. I'm still working on adding some edge cases but for the most part these functions will work for most cases.

Advice

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages