Results 1 to 2 of 2
Thread: Stack (push/pop/top)
- 03-08-2011, 02:23 AM #1
- 03-08-2011, 02:40 AM #2
I'm assuming top is the same as peek.
It is impossible to tell without knowing the order of statements.
Java Code:stack.top(); // Exception, 3 times, size = 0 stack.push(...); // 25 calls, size = 25 stack.pop(); // 10 calls, size = 15; stack.top(); // 9 times, size = 15; // or stack.pop(); // Exception, 3 times, size = 0; stack.push(...); // 25 calls, size = 25 stack.top(); // 12 times, size = 25 stack.pop(); // 7 times, size = 18; // or ......
Similar Threads
-
receiving gmails push-style with Javamail
By adhoc334 in forum Advanced JavaReplies: 0Last Post: 11-25-2010, 10:29 PM -
XML file and i want to push in specific URL through java thread
By naval gupta in forum Java ServletReplies: 1Last Post: 07-17-2009, 08:08 AM -
How to wrap words in checkbox,push buttons
By gunjan.raizada in forum SWT / JFaceReplies: 3Last Post: 08-05-2008, 12:24 PM -
Stack push/pop/peek operations
By Java Tip in forum Java TipReplies: 0Last Post: 01-29-2008, 09:03 AM -
SWT push button
By Java Tip in forum Java TipReplies: 0Last Post: 12-31-2007, 01:21 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks