

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


push(item) pop( ) peek( ) size( ) isEmpty( ) isFull( ) Constructor
ab
c top bottom
"Abstract"Stack items: Stack Object (^) a (^0 1) b (^) c 2 3 list Object
a) Complete the big-oh notation for the stack methods assuming this Python list implementation: ("n" is the # items) Big-oh
push(item) pop( ) peek( ) size( ) isEmpty( ) init
b) Which operations should have what preconditions?
Lecture 4 - Page 1
ab
c top bottom
ab
c top bottom
"Abstract"Stack "alternate" Stack Object items: (^) c (^0 1) b (^) a 2 3 list Object
a) Complete the big-oh notation for the “alternate” Stack methods: ("n" is the # items) Big-oh
push(item) pop( ) peek( ) size( ) isEmpty( ) init