Time Left - 15:00 mins

GATE 2019 - Programming & Data Structure Quiz-3

Attempt now to get your rank among 1249 students!

Question 1

Given an array A[-1:6,-2:10]. The base address of array is 1000. If every elements takes 4 bytes for storage then compute the address of element A[5,7]

Question 2

A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of the following statements is CORRECT (n refers to the number of items in the queue)?

Question 3

Consider 3 dimensional Array A[90][30][40] stored in linear array in row major order. If these base address starts at 10, what is the location of A[20][20][30]? Assume the first element is stored at A[1][1][1].

Question 4

Let A be an array with size of 2n. Array stores all positive integers in it randomly. Find the probability that a randomly chosen element of the array has an even subscript. [Array has subscripts from 1 to 2n]

Question 5

Suppose c = c[0],…,c[k−1] is an array of length k, where all the entries are from the set{0,1}. For any positive integers α and n, consider the following pseudo code.
DOSOMETHING(c, a, n)

If k=4, c=1,0,1,1, a =2 and n =8, then the output of DOSOMETHING(c, a, n)is___________.

Question 6

Suppose you are given an array s[1…n] and a procedure reverse (s,i,j) which reverses the order of elements in a between positions i and j (both inclusive).What does the following sequence do, where 1 k n:
reverse (s, 1, k);
reverse (s, k + 1, n);
reverse (s, 1, n);
  • 1249 attempts
  • 2 upvotes
  • 19 comments
Mar 31GATE & PSU CS