Takeaways
- Lists are a dynamic, linear collection of elements
- To use a List, we can use LinkedList, or ArrayList
- Linked list is a collection of Nodes that point to the next Node, starting from the head node
- Adding something to the beginning or end of a linked list is O(1) time
- Removing something to the beginning or end of a linked list is O(1) time
- Stacks are Last In First Out data structures, and Queues are First In First Out data structures
- To sort N items takes O(nlogn) time
- A Tree is a data structure that is a collection of nodes in a hierarchy (not a linear order)
- The root node is the node at the very top of the tree (trees grow down)
- Each node has a parent (except the root), and each node can have children
- Nodes are connected via edges, which creates a path through the tree
- The depth of a node is how many edges are taken to reach that node from the root
- The height of a tree is the maximum depth of one of its nodes
Code
January 16th's code represent some online shopping website where a user can add items to their cart. You can download the zip, extract it, and then import project with your IDE.
January 23rd's code is a tree data structure that represents a shell that will navigate a file system on a computer using commands (cd, ls, pwd, mkdir, etc).You can download the zip, extract it, and then import project with your IDE.