Which of the following statement(s) about stack data structure is/are NOT correct?
Which data structure is needed to convert infix notation to postfix notation?
Consider the usual algorithm for determining whether a sequence of parentheses is balanced.
The maximum number of parentheses that appear on the stack AT ANY ONE TIME when the algorithm analyzes: (()(())(())) are:
Assume that the operators +, -, × are left associative and ^ is right associative. The order of precedence (from highest to lowest) is ^, x , +, -. The postfix expression corresponding to the infix expression a + b × c – d ^ e ^ f is
Following is an incorrect pseudocode for the algorithm which is supposed to determine whether a sequence of parentheses is balanced:
declare a character stack
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?
The postfix form of the expression (A+ B)*(C*D- E)*F / G is?
Which of the following applications may use a stack?
In a stack, if a user tries to remove an element from empty stack it is called _________
Comment on the 2 arrays regarding P and Q:
int *a1[8];
int *(a3[8]);
P. Array of pointers
Q. Pointer to an array
Comment on the following statement:
int (*a)[7];
Consider an array consisting of –ve and +ve numbers. What would be the worst time comparisons an algorithm can take in order to segregate the numbers having same sign altogether i.e all +ve on one side and then all -ve on the other ?
Which of the following operations is not O(1) for an array of sorted data. You may assume that array elements are distinct.
What are the disadvantages of arrays?
When does the ArrayIndexOutOfBoundsException occur?
Which of these best describes an array?