Tuesday, August 25, 2015

AMCAT COMPUTER PROGRAMMMING PREVIOUS QUESTIONS (PAPERS)-9


81. A full binary tree with n non-leaf nodes contains.
A. (log n) nodes                                B. n+1 nodes                      C. 2n+1 nodes                   D. 2n nodes

Ans C
82. Every element of a data structure has an address and a key associated with it. A search mechanism deals with two or more values assigned to the same address by using the key. What is this search mechanism?
A. Linear Search                  B. Binary Search                  C. Hash Coded Search             D. None of these

Ans C

83. While calculating time complexity of an algorithm, the designer concerns himself/herself primarily with the run time and not the compile time why?
A. Runtime is always more than compile time     B. Compile time is always more than run time
C. Compile time is a function of run time               D. A program needs to be compiled once but can run several times.

Ans D

84. Shahana has a 10,000 line code. She is trying to debug it. She knows there is a logical error in the first 25 lines of the code. Which of the following options will be an efficient way of debugging?
    A. Compile the whole code and step into it line by line                               B. Use an interpreter on the first 25 lines
    C. Compile the whole code and run it                                                                 D. None of these

Ans B

85. function main()   {
                   integer i=0.7
                   static float m=0.7
                   if (m equals i)
print ”we are Equal”
                   else if( m>i )
print ”I am greater”
                   else
print ”I am lesser”
              }
A.  We are equal                 B.  I am greater                                  C.  I am lesser                                     D. This code will generate an error



86. Sorting is not possible by using which of the following methods?
A.      Insertion                         B. Selection                        C. Exchange                             D. Deletion

Ans D


87. Consider an array on which bubble sort is used. The bubble sort would compare the element A[x] to which of the following elements in a single iteration?
A.      A[x+1]                                 B.  A[x+2]                            C. A[x+2x]                          D. All of these

Ans D

88.  In an implementation of a linked list, each node contains data and address. Which of the following could the address field possibly contain? Choose the correct answer?
A. Address of next node in sequence   B. Its own address   C. Address of last node    D. Address of first node

Ans A

89. A variable cannot be used. Choose the correct answer
A. Before it is declared      B. After it is declared    C. In the function it is declared in   D. Can always be used

Ans A

90. Shashi writes a program in c++ and passes it on to pankaj; pankaj does some indentation in some statements of the code. What will this lead to? Choose the correct answer?

A. Faster execution        B. Lower memory requirement         C.  Correction of errors        D. Better readability

Ans D