Ds Lab Quiz Cse B

10 Questions | Total Attempts: 37

SettingsSettingsSettings
Please wait...
Ds Lab Quiz Cse B


Questions and Answers
  • 1. 
    The postfix form of the expression (A+ B)*((C*D− E)*F / G) is 
    • A. 

      AB+ CD*E − FG /**

    • B. 

      AB + CD* E − F **G /

    • C. 

      AB + CD* E − *F *G /

    • D. 

      AB + CDE * − * F *G / AB + CDE * − * F *G / AB + CDE * − * F *G / AB + CDE * − * F *G /

  • 2. 
    Overflow condition for simple linear queue array implementation is:
    • A. 

      Front = Maximum -1

    • B. 

      Rear = Maximum -1

    • C. 

      Front = Rear

    • D. 

      Front = -1

  • 3. 
    Memory arrangement in C language is:
    • A. 

      Row Major

    • B. 

      Column Major

    • C. 

      Diagonal

    • D. 

      None

  • 4. 
    What is the following code segment doing?void fn( ){               char c;               cin.get(c);               If (c != ‘\0’) {       fn( );      cout.put(c);  }} 
    • A. 

      The string entered is printed as it is.

    • B. 

      The string entered is printed in reverse order.

    • C. 

      It will go in an infinite loop.

    • D. 

      It will print an empty line.

  • 5. 
    When determining the efficiency of algorithm, the space factor is measured by 
    • A. 

      Counting the maximum memory needed by the algorithm

    • B. 

      Counting the minimum memory needed by the algorithm

    • C. 

      Counting the average memory needed by the algorithm

    • D. 

      Counting the maximum disk space needed by the algorithm

  • 6. 
    Struct node {      int data;      struct node *next;}*start = NULL;Consider the above representation and predict what will be printed on the screen by following statement ?start-->next-->data  
    • A. 

      None of these

    • B. 

      Access the “data” field of 2nd node

    • C. 

      Access the “data” field of 3rd node

    • D. 

      Access the “data” field of 1st node

  • 7. 
    Which one of the following represents an overflow condition for circular queue: 
    • A. 

      Front=0, Rear=Max-1

    • B. 

      Front=Rear

    • C. 

      Rear=0. Front=0

    • D. 

      Front=-1, Rear=-1

  • 8. 
    Random access is possible in: 
    • A. 

      Linked-List

    • B. 

      Array

    • C. 

      Queue

    • D. 

      Stack

  • 9. 
    Consider the following code:struct node{    int data;    struct node* next;}; static void reverse(struct node** head_ref){    struct node* prev   = NULL;    struct node* current = *head_ref;    struct node* next;    while (current != NULL)    {next  = current->next;         current->next = prev;          prev = current;        current = next;    }    *head_ref = prev;} The above code: 
    • A. 

      Sorts a linked list

    • B. 

      Exchange Values of consecutive nodes

    • C. 

      Reverses a linked list

    • D. 

      Assigns node value to each other in random order

  • 10. 
    /* Assume that n is greater than or equal to 0 */void fun2(int n){  if(n == 0)    return;   fun2(n/2);  printf("%d", n%2);} The function will display: 
    • A. 

      Counting from 1 to n

    • B. 

      Reverse Counting from n to 1

    • C. 

      Binary Equivalent of number n

    • D. 

      N is recursively divided by 2

Back to Top Back to top