Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

W Quiz_4_311_2021.doc File Edit Format Tools Help + Download Download Edits will not be automatically saved. Save now A Share Unsaved changes Normal Courier New

image text in transcribedimage text in transcribed

W Quiz_4_311_2021.doc File Edit Format Tools Help + Download Download Edits will not be automatically saved. Save now A Share Unsaved changes Normal Courier New 10 - BI U AA- 8. Which of the following statement about stack is NOT correct? A. Linked chains / lists are used for implementing stacks B. Top of the stack always contain the new node C. Stack is the FIFO data structure D. Stack is the LIFO data structure Explain your choice: 9. Suppose we have an array-based implementation of the stack class, with ten entries in the stack stored at items[0] through items[9]. The default capacity deCap is 50. Where does the push member function place the new entry in the array? A. items[0] B. items[1] C. items[9] D. items[10] Explain your choice: 10. Following is an incorrect pseudocode for the algorithm which is supposed to determine whether a sequence of parentheses is balanced: declare a stack of characters while( more input is available ) W Quiz_4_311_2021.doc File Edit Format Tools Help + Download Download Save now Edits will not be automatically saved. A Share Unsaved changes Normal Courier New 10 - BI U A A Explain your choice: 10. Following is an incorrect pseudocode for the algorithm which is supposed to determine whether a sequence of parentheses is balanced: declare a stack of characters while( more input is available ) { read a character if( the character is a '() push it on the stack else if( the character is a ') and the stack is not empty ) pop a character off the stack else print "unbalanced" and exit } print "balanced" Which of these unbalanced sequences does the above code think is balanced? A. (CO) B. () (0) C. (00)) D. (0) 0 Explain your choice

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions