DATASTRUCTURE AND ALGORITHM GATE NET MCQ SET – 9


 

  1. The recurrence relation that arises in relation with the complexity of binary search is
    1. T(n)=T(n/2)+k, where k is constant
    2. T(n)=2T(n/2)+k, where k is constant
    3. T(n)=T(n/2)+log(n)
    4. T(n)=T(n/2)+n
  1. The running time T(n), where `n’ is the input size of a recursive algorithm is given as followsT(n)=c+T(n-1),if n>1
    d, if n≤ 1
    The order of this algorithm is

    1. n2
    2. n
    3. n3
    4. nn
  1. The concept of order(Big O) is important because
    1. it can be used to decide the best algorithm that solves a given problem
    2. It determines the minimum size of a problem that can be solved in a given system, in a given amount of time
    3. It is the lower bound of the growth rate of the algorithm
    4. It is the average bound of the growth rate of the algorithm
  1. The concept of order(Big O) is important because
    1. it can not be used to decide the best algorithm that solves a given problem
    2. It determines the maximum size of a problem that can be solved in a given system, in a given amount of time
    3. It is the lower bound of the growth rate of the algorithm
    4. It is the average bound of the growth rate of the algorithm
  1. The time complexity of an algorithm T(n), where n is the input size is given byT(n)=T(n-1)+/n, if n>1
    =1 otherwise
    The order of the algorithm is

    1. log n
    2. n
    3. n2
    4. nn
  1. The running time of an algorithm is given byT(n)=T(n-1)+T(n-2)-T(n-3), if n>3
    = n otherwise
    The order of this algorithm is

    1. n
    2. log n
    3. nn
    4. n2
  1. If n=4,then the value of O(log n) is
    1. 1
    2. 2
    3. 4
    4. 8
  1. If n=4,then the value of O( n2) is
    1. 4 Rohith
    2. 16
    3. 64
    4. 512
  1. The average time complexity of insertion sort is
    1. O(n2)
    2. O(n)
    3. O(1)
    4. O(log n)
  1. The running time of an algorithm is given byT(n)=T(n-1)+T(n-2)-T(n-3), if n>3
    = n otherwise
    What should be the relation between T(1),T(2) and T(3) so that its order is constant.

    1. T(1)=T(2)=T(3)
    2. T(1)+T(3)=2T(2)
    3. T(1)-T(3)=T(2)
    4. T(1)+T(2)=T(3)
  1. The order of the algorithm that finds a given Boolean function of `n’ variables , produces a is
    1. constant
    2. linear
    3. non-linear
    4. exponential
  1. If n=16, then the value of O(n log n) is
    1. 16
    2. 32
    3. 64
    4. 128
  2. How many memory management functions are there in C
    1. 4
    2. 3
    3. 2
    4. 1
  3. Which of the following is not a C memory allocation function
    1. alloc( )
    2. calloc( )
    3. free
    4. malloc()
  1. If n= 8, then the value of O(1) is
    1. 1
    2. 2
    3. 4
    4. 8
  1. If n=4, then the value of O(n3) is
    1. 4
    2. 16
    3. 64
    4. 512
  2. If n=2, then the value of O(n) is
    1. 2
    2. 3
    3. 4
    4. 5
  1. All memory management functions are found in
    1. stdlib.c
    2. conio.h
    3. iostream.h
    4. math.h
  1. The function that returns memory to the heap is
    1. alloc( )
    2. free( )
    3. malloc( )
    4. realloc( )
  1. Which of the following statement about the releasing memory allocation is false?
    1. It is an error to dereference a pointer to allocated memory after the memory has been released
    2. It is an error to free memory with a pointer to other than the first element of an allocated array
    3. Memory should be freed as soon as it is no longer needed
    4. To ensure that it is released , allocated memory should be freed before the program
  1. The syntax of free() function
    1. void free(void* free)
    2. int free(void* ptr)
    3. float free(void* ptr)
    4. void free(ptr)
  1. Which of the memory function allocates a block of memory
    1. malloc ( )
    2. calloc( )
    3. release( )
    4. free( )
  1. Return type of a calloc( ) function is
    1. int
    2. float
    3. char
    4. void
  1. Return type of a realloc( ) function is
    1. int
    2. float
    3. char
    4. void
  1. Which of the following memory management function used to release memory
    1. malloc( )
    2. calloc( )
    3. release( )
    4. free( )
  1. Which of the following is considered auxiliary storage?
    1. disk
    2. random access memeory(RAM)
    3. read only memory(ROM)
    4. EEPROM
  1. Which of the following is not a standard file stream?
    1. stdin
    2. stderr
    3. stdfile
    4. stdout
  2. In C, local variable are stored in
    1. stack
    2. heap
    3. permanent storage
    4. hard disk
  1. The linked list field(s) are
    1. data
    2. pointer
    3. pointer to next node
    4. data and pointer to next node
  1. The linked list structure is defined as Rohith
    1. struct node
      {
      int item;
      struct node *next;
      };
    2. node
      {
      int item;
      struct node *next;
      };
    3. struct node
      {
      int item;
      node *node;
      };
    4. node
      {
      Int item;
      node next;
      };
  1. Dynamic memory area is
    1. heap
    2. stack
    3. permanent storage
    4. Hard disk
  1. The contents of the storage space allocated dynamically, can be accessed through _ _ _ _ _ _ _
    1. structure variables
    2. pointers
    3. unions
    4. arrays
  1. Each item in the list contains a link to structure containing the _ _ _ _ _ _ _ item
    1. previous
    2. next
    3. present
    4. last
  1. In C, program instructions are stored in
    1. stack
    2. heap
    3. permanent storage
    4. Hard disk
  2. In C, Global variables are stored in
    1. permanent storage
    2. stack
    3. heap
    4. Hard disk
  1. In C, static variables are stored in
    1. heap
    2. permanent storage
    3. Hard disk
    4. Stack
  1. A list refers to a set of items organized _ _ _ _ _
    1. sequentially
    2. exponentially
    3. non-sequentially
    4. factorially
  1. Each structure of a linked list consists _ _ _ _ _ _ _ no. of fields
    1. 2
    2. 3
    3. 4
    4. 1
  1. Linked lists are not suitable for data structures of which one of the following problem?
    1. insertion sort
    2. Binary search
    3. radix sort
    4. polynomial manipulation problem
  1. An item that is read as input can be either pushed to a stack and latter popped and printed, or printed directly. Which of the following will be the output if the input is the sequence of items-1,2,3,4,5?
    1. 3,4,5,1,2
    2. 3,4,5,2,1
    3. 1,5,2,3,4
    4. 5,4,3,1,2
  1. of pointers to be manipulated in a linked list to delete an item in the middle _ _ _ _ _ _ _
    1. Zero
    2. One
    3. Two
    4. Three
  2. of pointers to be manipulated in a linked list to delete first item
    1. Zero
    2. One
    3. Two
    4. Three
  1. Stack is useful for _ _ _ _ _ _ _
    1. radix sort
    2. breadth first search
    3. recursion
    4. quick sort
  2. The end of the list is marked as
    1. next=0
    2. (node.last = 0)
    3. next= &node;
    4. previous=0;
  1. of pointers to be manipulated in a linked list to insert an item in the middle _ _ _ _ _ _ _ _
    1. Two
    2. Three
    3. One
    4. Zero
  1. of pointers to be manipulated in a linked list to delete last item
    1. Zero
    2. One
    3. Two
    4. Three
  1. Single linked list uses _ _ _ _ _ _ no. of pointers
    1. Zero
    2. one
    3. Two
    4. Three
  1. LIFO is
    1. stack
    2. queue
    3. linked list
    4. tree
  1. A stack is has the entries a,b,c,(with a on top). Stack B is empty. An entry popped out of stack A can be printed immediately or pushed to stack B.An entry popped out of stack B can only be printed. In this arrangement, which of the following permutations a,b,c is not possible?
    1. b a c
    2. b c a
    3. c a b
    4. a b c

Leave a comment