github

Made bySaurav Hathi

CSE - Practice Test -13

Q1:

Which of the following statement(s) about stack data structure is/are NOT correct?

Tags:
Section:
Data Structures
Options:
Q2:

Which data structure is needed to convert infix notation to postfix notation?

Tags:
Section:
Data Structures
Options:
Q3:

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:

Tags:
Section:
Data Structures
Options:
Q4:

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

Tags:
Section:
Data Structures
Options:
Q5:

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?

Tags:
Section:
Data Structures
Options:
Q6:

The postfix form of the expression (A+ B)*(C*D- E)*F / G is?

Tags:
Section:
Data Structures
Options:
Q7:

Which of the following applications may use a stack?

Tags:
Section:
Data Structures
Options:
Q8:

In a stack, if a user tries to remove an element from empty stack it is called _________

Tags:
Section:
Data Structures
Options:
Q9:

Comment on the 2 arrays regarding P and Q:

 int *a1[8];

    int *(a3[8]);

    P. Array of pointers

    Q. Pointer to an array

 

Tags:
Section:
Data Structures
Options:
Q10:

Comment on the following statement:

    int (*a)[7];

Tags:
Section:
Data Structures
Options:
Q11:

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 ?

Tags:
Section:
Data Structures
Options:
Q12:

Which of the following operations is not O(1) for an array of sorted data. You may assume that array elements are distinct.

Tags:
Section:
Data Structures
Options:
Q13:

What are the disadvantages of arrays?

Tags:
Section:
Data Structures
Options:
Q14:

When does the ArrayIndexOutOfBoundsException occur?

Tags:
Section:
Data Structures
Options:
Q15:

Which of these best describes an array?

Tags:
Section:
Data Structures
Options: