Exams › GATE › Technical › GATE 2014 SET-2 COMPUTER - CS
3 questions with worked solutions.
Answer: 2^(2^(n-1))
Self-dual functions are those that remain unchanged when the operations of AND and OR are swapped. For n Boolean variables, there are 2^(n-1) independent pairs of inputs that can determine the function's output, leading to a total of 2^(2^(n-1)) distinct self-dual functions.
Answer: 1.73
The function is designed to find a value of x such that the square of x is approximately equal to 3, which corresponds to the square root of 3. The value 1.73 is the closest approximation to the square root of 3 (approximately 1.732), making it the correct choice.
Answer: A queue can be implemented where ENQUEUE takes a sequence of three instructions and DEQUEUE takes a single instruction.
With a REVERSE-capable stack you can implement a queue: ENQUEUE = REVERSE, PUSH, REVERSE (three instructions) inserts at the bottom, and DEQUEUE = POP (one instruction) removes the front. Thus option 2 is correct; ENQUEUE and DEQUEUE cannot both be single instructions, so the stored answer (idx 3) is wrong.