((MARKS)) (1/2/3...
)   1
((QUESTION))           What will be the output of the program ?
                       #include<stdio.h>
                       int main()
                       {
                           int a[5] = {5, 1, 15, 20, 25};
                           int i, j, m;
                           i = ++a[1];
                           j = a[1]++;
                           m = a[i++];
                           printf("%d, %d, %d", i, j, m);
                           return 0;
                       }
((OPTION_A))           2,1,15
((OPTION_B))           1,2,5
((OPTION_C))           3,2,15
((OPTION_D))           2,3,20
((CORRECT_CHOICE) C
) (A/B/C/D)
((EXPLANATION))        Step 1: int a[5] = {5, 1, 15, 20, 25}; The variable arr is declared as an
(OPTIONAL)             integer array with a size of 5 and it is initialized to
                       a[0] = 5, a[1] = 1, a[2] = 15, a[3] = 20, a[4] = 25 .
                       Step 2: int i, j, m; The variable i,j,m are declared as an integer type.
                       Step 3: i = ++a[1]; becomes i = ++1; Hence i = 2 and a[1] = 2
                       Step 4: j = a[1]++; becomes j = 2++; Hence j = 2 and a[1] = 3.
                       Step 5: m = a[i++]; becomes m = a[2]; Hence m = 15 and i is
                       incremented by 1(i++ means 2++ so i=3)
                       Step 6: printf("%d, %d, %d", i, j, m); It prints the value of the
                       variables i, j, m
                       Hence the output of the program is 3, 2, 15
((MARKS)) (1/2/3...)   1
((QUESTION))           In C, if you pass an array as an argument to a function, what actually gets
                       passed?
((OPTION_A))           Value of elements in array
                       First element of the array
((OPTION_B))
((OPTION_C))           Base address of the array
((OPTION_D))           Address of the last element of array
((CORRECT_CHOICE) C
) (A/B/C/D)
((EXPLANATION))        The statement 'C' is correct. When we pass an array as a funtion
(OPTIONAL)             argument, the base address of the array will be passed.
((MARKS)) (1/2/3...)   1
                       Which of the following statements are correct about 6 used in the
((QUESTION))
                       program?
                       int num[6];
                       num[6]=21;
((OPTION_A))           In the first statement 6 specifies a particular element, whereas in the
                       second statement it specifies a type.
((OPTION_B))           In the first statement 6 specifies a array size, whereas in the second
                       statement it specifies a particular element of array.
((OPTION_C))           In the first statement 6 specifies a particular element, whereas in the
                       second statement it specifies a array size.
((OPTION_D))           In both the statement 6 specifies array size.
((CORRECT_CHOICE) B
) (A/B/C/D)
((EXPLANATION))        The statement 'B' is correct, because int num[6]; specifies the size of
(OPTIONAL)             array and num[6]=21; designates the particular element(7thelement) of
                       the array.
((MARKS)) (1/2/3...)   1
((QUESTION))           What does the following declaration mean?
                       int (*ptr)[10];
((OPTION_A))           ptr is array of pointers to 10 integers
((OPTION_B))           ptr is a pointer to an array of 10 integers
((OPTION_C))           ptr is an array of 10 integers
((OPTION_D))           ptr is an pointer to array
((CORRECT_CHOICE) B
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))                   Which of the following statements are correct about an array?
                             1. The array int num[26]; can store 26 elements.
                             2. The expression num[1] designates the very first element in the
                                array.
                             3. It is necessary to initialize the array at the time of declaration.
                             4. The declaration num[SIZE] is allowed if SIZE is a macro.
                       1
((OPTION_A))
                       1,4
((OPTION_B))
                       2,3
((OPTION_C))
                       2,4
((OPTION_D))
((CORRECT_CHOICE) B
) (A/B/C/D)
((EXPLANATION))        1. The array int num[26]; can store 26 elements. This statement is
(OPTIONAL)             true.
                       2. The expression num[1] designates the very first element in the
                       array. This statement is false, because it designates the second
                       element of the array.
                       3. It is necessary to initialize the array at the time of declaration. This
                       statement is false.
                       4. The declaration num[SIZE] is allowed if SIZE is a macro. This
                       statement is true, because the MACRO just replaces the symbol SIZE
                       with given value.
                       Hence the statements '1' and '4' are correct statements.
((MARKS)) (1/2/3...)   1
((QUESTION))           The smallest element of an array index called……
                       Lower bound
((OPTION_A))
                       Upper bound
((OPTION_B))
                       Range
((OPTION_C))
                       None of Above
((OPTION_D))
((CORRECT_CHOICE) A
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           Which of the following function is used to find the first occurrence of a
                       given string in another string?
((OPTION_A))           strchr()
((OPTION_B))           strrchr()
((OPTION_C))           strstr()
((OPTION_D))           strnset()
((CORRECT_CHOICE) C
) (A/B/C/D)
((EXPLANATION))        char *strstr(const char *s1, const char *s2);
(OPTIONAL)             Return Value:
                       On success, strstr returns a pointer to the element
                       in s1 where s2 begins (points to s2 in s1).
                       On error (if s2 does not occur in s1), strstr returns null.
                       Example:
                       #include <stdio.h>
                       #include <string.h>
                       int main(void)
                       {
                           char *str1 = "IndiaBIX", *str2 = "ia", *ptr;
                           ptr = strstr(str1, str2);
                           printf("The substring is: %s\n", ptr);
                           return 0;
                       }
                       Output: The substring is: iaBIX
((MARKS)) (1/2/3...)   1
                       which of the following is not an asymptotic notation?
((QUESTION))
                       BIG-O
((OPTION_A))
                       Omega
((OPTION_B))
                       Phi
((OPTION_C))
((OPTION_D))           Theta
((CORRECT_CHOICE) A
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)                1
                       Step count for the following loop is
((QUESTION))
                               For(int i=5; i>0; i++)
                               5 times
((OPTION_A))
                               N+1 times
((OPTION_B))
                               Infinite
((OPTION_C))
                               No execution
((OPTION_D))
((CORRECT_CHOICE)                   C
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)                1
                       Time Complexity is
((QUESTION))
                               Time required for the machine to compile the program.
((OPTION_A))
                           Time required for the machine to execute the program.
((OPTION_B))
                               Time required for the machine to debug the program.
((OPTION_C))
                               None
((OPTION_D))
((CORRECT_CHOICE)                   C
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)                1
((QUESTION))           Which of the following data structure is not linear data
                       structure?
                               Array
((OPTION_A))
                          Linked list
((OPTION_B))
                               All of above
((OPTION_C))
                               None of above
((OPTION_D))
((CORRECT_CHOICE)                  C
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)               1
((QUESTION))           Which of the followings are application of data structure?
                               Facebook
((OPTION_A))
                          Searching
((OPTION_B))
                               Sorting
((OPTION_C))
                               All of above
((OPTION_D))
((CORRECT_CHOICE)                  D
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)               1
((QUESTION))           Which data structure is used for implementing recursion?
                       Queue
((OPTION_A))
                          Stack
((OPTION_B))
                       Array
((OPTION_C))
                       List
((OPTION_D))
((CORRECT_CHOICE)                        B
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)                     1
((QUESTION))           Representation of data structure in memory is known
                       as………….
((OPTION_A))           recursive
((OPTION_B))           Abstract Data Type
((OPTION_C))           Storage Structure
((OPTION_D))           File Structure
((CORRECT_CHOICE) B
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)                     1
((QUESTION))           In a linked list with n nodes, the time taken to insert an
                       element after an element pointed by some pointer is……..
((OPTION_A))                  O (1)
                              O(log n)
((OPTION_B))
                                  O(n)
((OPTION_C))
                                  O(n log n)
((OPTION_D))
((CORRECT_CHOICE)                        B
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)              1
((QUESTION))           In a circular linked list……….
((OPTION_A))           components are all linked together in some sequential
                       manner.
((OPTION_B))           there is no beginning and no end.
((OPTION_C))           components are arranged hierarchically.
((OPTION_D))           forward and backward traversal within the list is permitted.
((CORRECT_CHOICE)                 B
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)              1
((QUESTION))           Which of the following operators takes only integer
                       operands?
                              +
((OPTION_A))
                          /
((OPTION_B))
                              %
((OPTION_C))
                              *
((OPTION_D))
((CORRECT_CHOICE)                 C
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)                  1
((QUESTION))           NULL pointer is used to define .....
                               End of the linked list
((OPTION_A))
                           Empty list
((OPTION_B))
                               Empty pointer field of the structure
((OPTION_C))
                               All of above
((OPTION_D))
((CORRECT_CHOICE)                     D
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)                  1
((QUESTION))           The function that return memory to heap is called...........
                               Allloc()
((OPTION_A))
                           Malloc()
((OPTION_B))
                               Calloc()
((OPTION_C))
                               Free()
((OPTION_D))
((CORRECT_CHOICE)                     D
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           Two main measures for the efficiency of an algorithm are
((OPTION_A))           Processor and memory
((OPTION_B))           Complexity and capacity
((OPTION_C))           Time and space
((OPTION_D))           Data and space
((CORRECT_CHOICE) C
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           Which of the following case does not exist in complexity theory
((OPTION_A))           Best case
                       Worst case
((OPTION_B))
((OPTION_C))           Average case
((OPTION_D))           Null case
((CORRECT_CHOICE) D
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
                       The Worst case occur in linear search algorithm when 
((QUESTION))
((OPTION_A))           Item is somewhere in the middle of the array
((OPTION_B))           Item is not in the array at all
((OPTION_C))           Item is the last element in the array
((OPTION_D))            Item is the last element in the array or is not there at all
((CORRECT_CHOICE) D
) (A/B/C/D)
((EXPLANATION))        .
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           The complexity of merge sort algorithm is
((OPTION_A))           O(n)
((OPTION_B))           O(log n)
((OPTION_C))           O(n2)
((OPTION_D))           O(n log n)
((CORRECT_CHOICE) D
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           The input to a merge sort is 6,5,4,3,2,1 and the same input is applied to
                       quick sort then which is the best algorithm in this case 
                       Merge sort
((OPTION_A))
((OPTION_B))           Quick sort
((OPTION_C))           Both have same time complexity in this case as they have same running
                       time
((OPTION_D))           Cannot be decided
((CORRECT_CHOICE) A
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
                       If there exists two functions f(n) and g(n). The constant c>0 and there exists
((QUESTION))
                       an integer constant n0>=1. If f(n)<=c*g(n) for every integer n>= n 0 then we
                       say that____
                       f(n)=O(g(n))
((OPTION_A))
                       f(n)=Θ (g(n))
((OPTION_B))
((OPTION_C))           f(n)=Ω (g(n))
f(n)=Θ (g(n))          f(n)=o(g(n))
((CORRECT_CHOICE) A
) (A/B/C/D)
((EXPLANATION))        Basic definition of big oh notation
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           In practice ______ is used to define tight upper bound on growth of
                       function f(n)
((OPTION_A))           Big oh
((OPTION_B))           Big omega
((OPTION_C))           Big theta
((OPTION_D))           None of these
((CORRECT_CHOICE) A
) (A/B/C/D)
((EXPLANATION))        The definition of big oh notation is f(n)<=c*g(n) which defines the
(OPTIONAL)             upper bound on growth of the function f(n)
((MARKS)) (1/2/3...)   1
((QUESTION))           Examples of O(1) are ______
((OPTION_A))           Multiplying two numbers
((OPTION_B))           Assigning some value to a variable
((OPTION_C))           Displaying some integer on console
((OPTION_D))           All of the above
((CORRECT_CHOICE) D
) (A/B/C/D)
((EXPLANATION))        All these operations are computed by single line expression
(OPTIONAL)             evaluation
((MARKS)) (1/2/3...)   1
((QUESTION))           Examples of O(n2) algorithms are
((OPTION_A))           Adding two matrices
((OPTION_B))           Finding transpose of a matrix
((OPTION_C))           Initializing all elements of the matrix by 0
((OPTION_D))           All of the above
((CORRECT_CHOICE) D
) (A/B/C/D)
((EXPLANATION))        Within two for loops(nested), all these operations are performed.
(OPTIONAL)
((MARKS)) (1/2/3...)   1
                       Choose the correct time complexity of following code__
((QUESTION))
                       while(n>0)
                       {
                       n=n/10
                       }
                       O(1)
((OPTION_A))
                       O(n)
((OPTION_B))
                       O(log n)
((OPTION_C))
((OPTION_D))           O(n2)
((CORRECT_CHOICE) C
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
                       The time complexity of binary search is_____
((QUESTION))
                       O(n)
((OPTION_A))
                       O(log n)
((OPTION_B))
                       O(n log n)
((OPTION_C))
((OPTION_D))           O(n2)
((CORRECT_CHOICE) B
) (A/B/C/D)
((EXPLANATION))        The list is divided at the mid and then the element is searched in
(OPTIONAL)             either left half or right half.
((MARKS)) (1/2/3...)   1
((QUESTION))           Consider recurrence relation as
                       T(0)=c1
                       T(n)=T(n-1)+c2
                       This can be expressed as
                       O(n)
((OPTION_A))
                       O(log n)
((OPTION_B))
                       O(n log n)
((OPTION_C))
((OPTION_D))           O(n2)
((CORRECT_CHOICE) A
) (A/B/C/D)
((EXPLANATION))        T(n)=T(n-1)+c2
(OPTIONAL)                    =T(n-2)+2c2
                              =T(n-3)+3c2
                              =T(n-k)+kc2
                       If k=n then T(n)=c1+nc2 Hence, T(n)=O(n)
((MARKS)) (1/2/3...)   1
((QUESTION))           Consider recurrence relation as
                       T(0)=c1 and T(1)=c2
                       T(n)=T(n/2)+c3
                       This can be expressed as
                       O(n)
((OPTION_A))
                       O(log n)
((OPTION_B))
                       O(n log n)
((OPTION_C))
((OPTION_D))           O(n2)
((CORRECT_CHOICE) B
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           Following is the method of solving recurrence relation
((OPTION_A))           Greedy method
((OPTION_B))           Backtracking
((OPTION_C))           Forward substitution method
((OPTION_D))           Divide and Conquer method
((CORRECT_CHOICE) C
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
                       The recurrence relation for factorial function is of the form _______
((QUESTION))
((OPTION_A))           T(n)=T(n-1)+c
((OPTION_B))           T(n)=T(n-1)+T(n-2)+c
((OPTION_C))           T(n/2)+c
((OPTION_D))           None of these
((CORRECT_CHOICE) A
) (A/B/C/D)
((EXPLANATION))        The factorial function is as follows-
(OPTIONAL)             fact(n)
                       {
                           if n=1
                                return 1
                          else
                                return n * fact(n-1)
                       }
((MARKS)) (1/2/3...)   1
((QUESTION))           The recurrence relation for fibonacci function is of the form _______
((OPTION_A))           T(n)=T(n-1)+c
((OPTION_B))           T(n)=T(n-1)+T(n-2)+c
((OPTION_C))           T(n/2)+c
((OPTION_D))           None of these
((CORRECT_CHOICE) B
) (A/B/C/D)
((EXPLANATION))        The fibonacci function is as follows-
(OPTIONAL)             fibb(n)
                       {
                           if n = = 0
                                return 0
                           if n = = 1
                                return 1
                           else
                                return (fibb(n-1) + fibb(n-2))
                       }
((MARKS)) (1/2/3...)   1
((QUESTION))           The frequency count of following code is____
                       for(i=0;i<m;i++)
                       {
                          for(j=0;i<n;j++)
                          {
                             C[i][j]=a[i][j]+b[i][j];
                          }
                       }
((OPTION_A))           m + mn + mn
((OPTION_B))           m + n + mn
((OPTION_C))           m + n2 + mn
((OPTION_D))           (m+1) + m(n+1) + mn
((CORRECT_CHOICE) D
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           Consider T(n)=15n3 + n2 + 4. Select the correct statement
((OPTION_A))           T(n)=O(n4)
((OPTION_B))           T(n)=Ω (n3)
((OPTION_C))           T(n)=Ω (n2)
((OPTION_D))           All of the above
((CORRECT_CHOICE) D
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           Give the frequency count of 3rd Statement
                                 for(i=1;i<=n;i++)
                                 for(j=1;j<=i;j++)
                                 x=x+1;
((OPTION_A))           ½(n2+n)
((OPTION_B))           ½(n2+3n)
((OPTION_C))           n2
((OPTION_D))           (n+1)2
((CORRECT_CHOICE) A
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))               There are four algorithms for solving a problem. Their time complexities
                            are O(n), O(n2), O(log n) and O(n log n). Which is the best algorithm?
((OPTION_A))           O(n)
((OPTION_B))           O(n2)
((OPTION_C))           O(log n)
((OPTION_D))           O(n log n)
((CORRECT_CHOICE) C
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           The order of the recurrence relation a r-7ar-1+10ar-2=0 is ______.
((OPTION_A))           3
((OPTION_B))           2
((OPTION_C))           1
((OPTION_D))           B
((CORRECT_CHOICE) D
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           Characteristic roots of the recurrence relation ar-2ar-1+ar-2=0 are _______
((OPTION_A))           1, -1
((OPTION_B))           -1, -1
((OPTION_C))           1, 1
((OPTION_D))           None of these
((CORRECT_CHOICE) C
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           Charactristic polynomial of the recurrence relation b n=-3bn-1-bn-2 is
                       ________.
((OPTION_A))           Z2-3Z-2=0
((OPTION_B))           Z2+3Z-2=0
((OPTION_C))           Z2+3Z+2=0
((OPTION_D))           None of these
((CORRECT_CHOICE) C
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           The general solution of the recurrence relation a r-2ar-1=0 is _____.
((OPTION_A))           ar=c1(-2)r
((OPTION_B))           ar=c2(2)r
((OPTION_C))           ar=c1(1)r
((OPTION_D))           None of these
((CORRECT_CHOICE) B
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           Consider the recurrence relation, an=an-1+2an-2 with a9=3 and a10=5. Find a7.
((OPTION_A))           1
((OPTION_B))           3
((OPTION_C))           5
((OPTION_D))           None
((CORRECT_CHOICE) A
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           Charactristic polynomial of the recurrence relation a r+2-ar-2=0 is ______.
((OPTION_A))           Z-1=0
((OPTION_B))           Z2-1=0
((OPTION_C))           (Z-1)2=0
((OPTION_D))           None
((CORRECT_CHOICE) D
) (A/B/C/D)
((EXPLANATION))        Given homogeneous recurrence relation can be written as
(OPTIONAL)             ar+2+0ar+1+0ar+0ar-1-ar-2=0
                       Order of this recurrence relation is 4.
                       Hence characteristic polynomial is Z4-1=0
((MARKS)) (1/2/3...)   1
((QUESTION))           The postfix equivalent of the prefix *+ab-cd is ______.
((OPTION_A))           ab+cd-*
((OPTION_B))           ab+cd*-
((OPTION_C))           abcd+*-
((OPTION_D))           ab-cd+*
((CORRECT_CHOICE) A
) (A/B/C/D)
((EXPLANATION))
(OPTIONAL)
((MARKS)) (1/2/3...)   1
((QUESTION))           What does the following function check for? (all necessary headers to
                       be included and function is called from main)
                           #define MAX 10
                        
                           typedef struct stack
                           {
                                int top;
                                int item[MAX];
                           }stack;
                        
                           int function(stack *s)
                           {
                                if(s->top == -1)
                                    return 1;
                                 else return 0;
                           }
                       full stack
((OPTION_A))
                       invalid index
((OPTION_B))
                       empty stack
((OPTION_C))
((OPTION_D))           infinite stack
((CORRECT_CHOICE) C
) (A/B/C/D)
((EXPLANATION))        Answer: c
(OPTIONAL)             Explanation: An empty stack is represented with the top-of-the-stack(‘top’
                       in this case) to be equal to -1.