Time Left - 40:00 mins

IIIT Hyderabad Semi Syllabus Quiz-1

Attempt now to get your rank among 170 students!

Question 1

What is the output of above program ?

Question 2

Find the right option
#include<stdio.h>
int main()
{
     int n;
     printf("enter a no. : ");
     scanf(" %d",&n);
     (n & 1)?printf("yes"):printf("No");
}

Question 3

Number of zeros in the output?

Question 4

In a doubly linked list pointed by head node, a pointer ‘p’ points to an arbitrary element in the middle of the list. Which of the following sets of operations would correctly insert a new node, pointed to by pointer ‘n’ to the right of ‘p’?

Question 5

We have a program that reads 200 integers in the range (0,50). If the program prints frequency of the each integer above 30 and less than or equal to 50, then what would be the best way for program to store the frequencies?

Question 6

Algorithm

P. Binary Search

Q. Strassen’s Matrix Multiplication

R. Merge Sort

S. Insertion Sort

Time Complexity

(i) O (n2.71 )

(ii) O (n2)

(iii) O (log n)

(iv) O (n log n)

Match the Algorithm with its correct Time Complexity:

Question 7

Consider a scenario, where the standard Quick Sort algorithm is run on the following 2 inputs to keep in ascending order.

(i) 1, 4, 5 , 7 , 10 , ..................... n (already sorted in ascending order)

(ii) n, n-1, n-2 , n-3 , .........................3 , 2 , 1 (sorted in descending order)

Let c1 and c2 be the number of swaps required for the inputs (i) and (ii) respectively. Then find the relation between c1 and c2?

Question 8

We are provided with a 2 x n array of integers. What is the time complexity to calculate the rectangular 1x2 or 2 x1 array whose sum of elements is maximum?
Example:

Here ans is 12

Question 9

What is the time complexity of the following recursive function:
int DoSomething (int n) {
if (n <= 2)
return 1;
else
return(DoSomething(floor(sqrt(n))) + n);
}

Question 10

Let A1, A2, A3 and A4 be the matrices with the following dimension 10 X 3, 3 X 20, 20 X 10, 10 X 5 respectively. Which of the following two matrices should be multiplied first so that minimum scalar multiplication occur?

Question 11

Consider the following table of arrival time and burst time for three processes P1, P2 and P3.

Suppose that a fourth process P4 enters the system at time 7.6 sec and needs 6 sec of CPU time. Also assume that P2, P3 belong to one queue and P1, P4 belong to another queue.
A modified multilevel queue is in effect. The first queue is for P2, P3 processes that get 1 sec each time they are in CPU. The second queue processes P1, P4 get upto 4 units each time they are in CPU. Processes are dispatched with the following strategies like, two processes (if available) are dispatched from the first queue followed by one process (if available) from the second queue. What will be the average turnaround time?

Question 12

Consider the following statements:
S1 : The total size of address space in a virtual memory system is limited by the available main memory.
S2 : The best fit techniques for memory allocation ensures the memory will never be fragmented.
S3 : Locality of reference implies that the page reference being made by a process will always be the page that is being used in the previous page reference
S4 : Virtual memory reduces the context switching overhead.
How many of the above statements are false?

Question 13

Consider a disk system with 100 cylinders. The requests to access the cylinders occur in following sequence:
4, 34, 10, 7, 19, 73, 2, 15, 6, 20
Assuming that the head is currently at cylinder 50, what is the time taken to satisfy all requests if it takes 1 ms to move from one cylinder to adjacent one and shortest seek time first policy is used ?

Question 14

Consider the following statement regarding CISC computer:
S1: It supports more addressing modes.
S2: It contains large instruction set.
S3: It is more suitable for general purpose system.
Which of the following is false?

Question 15

Which of the following must be true for the RFE (Return from Exception) instruction on a general purpose processor?
(1) It must be a trap instruction
(2) It must be a privileged instruction
(3) An exception cannot be allowed to occur during execution of an RFE instruction

Question 16

Which register of current procedure resemble physically similar to the parameter register of called procedure during register to register operation in an overlapping window of RISC Processors?

Question 17

The value of a float type variable is represented using the single — precision 32 bit floating point format of IEEE — 754 standard that uses 1 bit for sign, 8 bits for biased exponent and 23 bits for mantissa. A float type variable X is assigned to the decimal value of 18.75 . The representation of X in hexadecimal notation is

Question 18

Consider three registers R1, R2, and R3 that store numbers in IEEE-754 single precision floating point format. Assume that R1 and R2 contain the values (in hexadecimal notation) 0×42200000 and 0×C1200000, respectively.

If What is the value stored in R3?

Question 19

If the decimal number is 3.248 x 104 then its 32-bit equivalent floating number is

Question 20

Consider the following processors (ns stands for nanoseconds). Assume that the pipeline registers have zero latency.

P1: Four-stage pipeline with stage latencies 1 ns, 2 ns, 2 ns, 1 ns.

P2: Four-stage pipeline with stage latencies 1 ns, 1.5 ns, 1.5 ns, 1.5 ns.

P3: Five-stage pipeline with stage latencies 0.5 ns, 1 ns, 1 ns, 0.6 ns, 1 ns.

P4: Five-stage pipeline with stage latencies 0.5 ns, 0.5 ns, 1 ns, 1 ns, 1.1 ns.

Which processor has the highest peak clock frequency?

  • 170 attempts
  • 0 upvotes
  • 0 comments
Oct 3GATE & PSU CS