CSE 116 Lecture Notes - Lecture 34: Binary Tree, Child Process

19 views4 pages

Document Summary

Works like stack of chips: add by pushing data onto top, pop top item off to remove. Accessing other values impossible top item only is available: cardboard tube/private fields get in the way. Peek just accesses top element without removing it. Don"t use any other list methods with the stack, otherwise sad kittens size, isempty. Add: enqueue -> adds to the front of the list, shifts things over so o(n) operation. Peek: peek remove: dequeue -> removes from the end of the list so o(1) operation. First check base case that has a clear and easy solution. Recursive step solves 1 problem using call to itself. Consider splitting methods in two: public method starts process & private method recurs. Yet another collection: any implementation okay, # of elements is its size. Some things are familiar: using nodes to hold elements.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents