CP164 Lecture Notes - Lecture 5: Iter

43 views4 pages
School
Course
Professor

Document Summary

Using a stack ( create a stack object using definition of creating a stack variable=stack() Only methods you are going to use are push,pop,peek, is empty. Write new method to it ( like reverse) Not extending a stack does not go into stack file but instead utilities. py. Stack_test function if you run is_empty test that you wrote it should return true. Then we should push one piece of data. Then use peek to see if item is at top of array. Make sure code i wrote for this data structure work. As long as stack is not empty keep removing items and when it is empty is should stop. Should not change code from numbers to food (q. Just change list you are sitting ( q5 figure it out how to test with stack_test) Mirror is similar to palindrome (from last assignment) Could use stack (last in for out)

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