Home
About Us
Contact Us
Bookmark
Saved Bookmarks
Current Affairs
General Knowledge
Chemical Engineering
UPSEE
BSNL
ISRO
BITSAT
Amazon
ORACLE
Verbal Ability
→
GATE
→
Cs 2022 in Gate
→
If a stack S contains the integers 2, -3, 2, -1, 2...
1.
If a stack S contains the integers 2, -3, 2, -1, 2 in order from bottom to top, what is f(S)?(A) 6(B) 4(C) 3(D) 2
Answer»
Show Answer
Discussion
No Comment Found
Post Comment
Related InterviewSolutions
In a binary tree, for every node the difference between the number of nodes in the left and right subtrees is at most 2. If the height of the tree is h > 0, then the minimum number of nodes in the tree is:(A) 2h – 1(B) 2h – 1 + 1(C) 2h – 1(D) 2h
What is the output printed by the following program?#include<stdio.h>int f(int n, int k){if (n == 0)return 0;else if (n % 2)return f(n/2, 2*k) + k;else return f(n/2, 2*k) - k;}int main (){printf("%d", f(20, 1));return 0;}(A) 5(B) 8(C) 9(D) 20
The following C function takes two ASCII strings and determines whether one is an anagram of the other. An anagram of a string s is a string obtained by permuting the letters in s.int anagram (char *a, char *b) {int count [128], j;for (j = 0; j < 128; j++) count[j] = 0;j = 0;while (a[j] && b[j]) {A;B;}for (j = 0; j < 128; j++) if (count [j]) return 0;return 1;}Choose the correct alternative for statements A and B.(A) A : count [a[j]]++ and B : count[b[j]]–(B) A : count [a[j]]++ and B : count[b[j]]++(C) A : count [a[j++]]++ and B : count[b[j]]–(D) A : count [a[j]]++and B : count[b[j++]]–
If a stack S contains the integers 2, -3, 2, -1, 2 in order from bottom to top, what is f(S)?(A) 6(B) 4(C) 3(D) 2
The availability of a complex software is 90%. Its Mean Time Between Failure (MTBF) is 200 days. Because of the critical nature of the usage, the organization deploying the software further enhanced it to obtain an availability of 95%. In the process, the Mean Time To Repair (MTTR) increased by 5 days.What is the MTBF of the enhanced software(A) 205 days(B) 300 days(C) 500 days(D) 700 days
In a data flow diagram, the segment shown below is identified as having transaction flow characteristics, with p2 identified as the transaction centerA first level architectural design of this segment will result in a set of process modules with an associated invocation sequence. The most appropriate architecture is(A) p1 invokes p2, p2 invokes either p3, or p4, or p5(B) p2 invokes p1, and then invokes p3, or p4, or p5(C) A new module Tc is defined to control the transaction flow. This module Tc first invokes pl and then invokes(D) A new module Tc is defined to control the transaction flow. This module Tc invokes p2. p2 invokes p1, and then invokes p3, or p4, or p5
A table has fields Fl, F2, F3, F4, F5 with the following functional dependencies F1 → F3 F2→ F4 (F1 . F2) → F5In terms of Normalization, this table is in(A) 1 NF(B) 2 NF(C) 3 NF(D) none
The circuit shown below implements a 2-input NOR gate using two 2-4 MUX (control signal 1 selects the upper input). What are the values of signals x, y and z?(A) 1, 0, B(B) 1, 0, A(C) 0, 1, B(D) 0, 1, A
Q82_Part BA database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400 records and occupies 20 disk blocks. These two tables have to be joined as per a specified join condition that needs to be evaluated for every pair of records from these two tables. The memory buffer space available can hold exactly one block of records for T1 and one block of records for T2 simultaneously at any point in time. No index is available on either table.If, instead of Nested-loop join, Block nested-loop join is used, again with the most appropriate choice of table in the outer loop, the reduction in number of block accesses required for reading the data will be(A) 0(B) 30400(C) 38400(D) 798400
Q 82_Part AA database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400 records and occupies 20 disk blocks. These two tables have to be joined as per a specified join condition that needs to be evaluated for every pair of records from these two tables. The memory buffer space available can hold exactly one block of records for T1 and one block of records for T2 simultaneously at any point in time. No index is available on either table.If Nested-loop join algorithm is employed to perform the join, with the most appropriate choice of table to be used in outer loop, the number of block accesses required for reading the data are(A) 800000(B) 40080(C) 32020(D) 100
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply
Your experience on this site will be improved by allowing cookies. Read
Cookie Policy
Reject
Allow cookies