- Describe how objects are stored in memory
- Diagram how objects that refer to other objects are stored in memory
- Create a
Nodeclass that can hold referential information (nested data) - Implement a
SinglyLinkedListclass that stores a list ofNodespush: adds a newNodeto the endpop: removes aNodefrom the end
- Explain the Big O complexity of common linked-list methods
-
How are objects (reference types) stored in memory?
Your answer...
-
Draw the call stack and the heap for the following code:
const tree = { heigth: 15, color: 'green' } const flower = { type: 'daisy', color: 'yellow' }
-
Draw the call stack and the heap for the following code:
const salsa = { ingredient: 'tomatoes' } const dip = { ingredient: 'black beans', nextLayer: salsa }
When you're finished, add your next favorite layer to the dip! How does your data structure mantain the order of the ingredients?
valproperty can hold any standard data typenextproperty stores a reference to anotherNodeor null
- Include
headandtailproperties - Include
pushandpopmethods
- What is the worst-case Big O complexity of
push? - What is the worst-case Big O complexity of
pop?