A program P reads in 500 integers in the range (0,100) representing the scores of 500 students.If prints the frequency of each score above 50, what would be the best way for P to store the frequencies?
Let A be a square matrix of size nxn. Consider the following pseudocode. What is the expected output?
1 Crore+ students have signed up on EduRev. Have you? Download the App |
The following sequence of operations is performed on a stack:
PUSH (10), PUSH (20), POP, PUSH (10), PUSH (20), POP, POP, POP, PUSH (20), POP
The sequence of values popped out is:
Which of the following permutations can be obtained in the output (in the same order) using a stack assuming that the input is the sequence 1,2, 3, 4, 5 in that order?
The postfix expression for the infix expression A + B * ( C + D ) / F + D * E is
Consider the following statements:
(i) First-in-first out types of computations are efficiently supported by STACKS.
(ii) Implementing LISTS on linked lists is more efficient than implementing LISTS on an array for almost all the basic LIST operations.
(iii) Implementing QUEUES on a circular array is more efficient than implementing QUEUES, on a linear array with twg indices.
(iv) Last-in-first-out type of computations are efficiency supported by QUEUES.
Which of the following is essential for converting an infix expression to the post fix form efficiently?
A priority queue Q is used to implement a stack that stores characters. PUSH (C) is implemented INSERT (Q, C, K) where K is an appropriate integer key chosen by the implementation. POP is implemented as DELETEMIN(Q). For a sequence of operations, the keys chosen are in
What value would the following function return for the input x - 95?
Function fun (x: integer): integer;
Begin
If x > 100 then fun = x - 10
Else fun := fun(fun (x + 11))
End;
The best data structure to check whether an arithmetic expression has balanced parentheses is a
A circularly linked list is used to represent a Queue. A single variable p is used to access the Queue. To which node should p point such that both the operations enQueue and deQueue can be performed in constant time?
Assume that the operators + , -, x 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 x c - d ^ e ^ f is
A program attempts to generate as many permutations as possible of the string, ‘abcd' by pushing the characters a, b, c, d in the same order onto a stack, but it may pop off the top character at any time. Which one of the following strings CANNOT be generated using this program?
The following postfix expression with single digit operands in evaluated using a stack
8 2 3 ^ / 2 3* + 5 1 * -
Note that A is the exponentiation operator. The top two elements of the stack after the first* is evaluated are
Suppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this modified stack? .
The result evaluating the postfix expression 10 5 + 60 6/* 8 - is
In a circular linked list organization, insertion of a record involves modification of
Linked lists are not suitable data structures of which one of the following problems?
In the worst case, the number of comparisons needed to search singly linked list of length n for a given element is
Consider the function f defined below:
For a given linked list p, the function f returns 1 if and only if
63 videos|8 docs|165 tests
|
63 videos|8 docs|165 tests
|