第一章 单元测试

1、单选题:The algorithm and flowchart can help us to
A:To know the memory capacity

B:Identify the data type of a variable

C:To store the data

D:Specify the problem completely and clearly

正确答案:【Specify the problem completely and clearly

2、单选题:The rhombus or diamond shape in flowcharting denotes
A:Decision

B:Initialization

C:Input

D:Output

正确答案:【Decision

3、单选题:Which of the following is not an advantage of a flowchart?
A:Improper documentation

B:Systematic testing

C:Efficient coding

D:Better communication

正确答案:【Improper documentation

4、单选题:The flowchart symbols used for start and stop operations are called as_______.

A:terminals

B:processing

C:decision

D:connectors
正确答案:【terminals

5、单选题:The formula Fn = Fn-1+Fn-2  will produce
A:Ramanujan Number

B:Euler Number

C:Fibonacci Number

D:Prime Number

正确答案:【Fibonacci Number

6、单选题:The main measures for the efficiency of an algorithm are
A:Processor and memory

B:Data and space

C:Complexity and capacity

D:Time and space

正确答案:【Time and space

7、单选题:Which one of the following is the constant time complexity in terms of Big-Oh notation
A:O(n)

B:O(n2)

C:O(1)

D:O(n3)

正确答案:【O(1)

8、单选题:

What is the time complexity of the following code?

       int a=0;

for(i=0;i<n;i++){

for(j=n;j>i;j–){

a=a+i+j;}}
A:O(n)

B:O(1)

C:O(nlogn)

D:O(n2)

正确答案:【O(n2)

9、单选题:Which one of the following is an example for exponential time complexity?
A:O(2n)

B:O(n2)

C:O(1)

D:O(n)

正确答案:【O(2n)

10、单选题:For larger values of n, which one represents the slowest time?
A:O(n!)

B:O(2n)

C:O(n2)

D:O(n)

正确答案:【O(n!)

第二章 单元测试

1、单选题:Deletion of an element from the array reduces the size of array by ___________.
A:three

B:one

C:zero

D:two

正确答案:【one

2、单选题:Assuming that int is of 4 bytes, what is the size of int arr[10];?
A:10

B:30
C:40
D:20
正确答案:【40】

3、单选题:Two dimensional arrays are useful when the elements being processed are to be arranged in the form of ___________.
A:Both (a) and (b)

B:rows

C:columns

D:None of the above

正确答案:【Both (a) and (b)

4、单选题:In the polynomial,  A(x)= 3x2+2x+4, the degree of this polynomial is
A:1
B:3
C:0

D:2
正确答案:【2】

5、单选题:In the polynomial,  A(x)= 3x2+2x+4, coefficient of first term is
A:0

B:2
C:1
D:3
正确答案:【3】

6、单选题:

A matrix having a larger number of elements with zero values than the number of non-zero elements is said to be a_____________.
A:    sparse matrix

B:    triangular matrix

C:    zero matrix

D:    diagonal matrix

正确答案:【    sparse matrix

7、单选题:While representing the sparse matrix A (m×n) with t non-zero terms in 3-tuples form, the size of the matrix becomes
A:t × n

B:m × n

C:3 × t

D:(t+1) × 3

正确答案:【(t+1) × 3

8、单选题:

Considering a sparse of m×n matrix with t non-zero terms, in FAST_TRANSPOSE algorithm, the size of one-dimensional array (S or T) is equal to:
A:t
B:n+t
C:n

D:m
正确答案:【n

9、单选题:Considering a sparse of m×n matrix with t non-zero terms, the time complexity of TRANSPOSE algorithm is:
A:O(n+t)

B:O(n*t)

C:O(n-t)

D:O(nt)

正确答案:【O(n*t)

10、单选题:

Which of the following statement is true regarding TRANSPOSE and FAST_TRANSPOSE algorithms.
A:

Time complexities of TRANSPOSE and FAST_TRANSPOSE are same

B:The TRANSPOSE algorithm is slower than FAST_TRANSPOSE

C:None of the above

D:

The TRANSPOSE algorithm is faster than FAST_TRANSPOSE

正确答案:【The TRANSPOSE algorithm is slower than FAST_TRANSPOSE

第三章 单元测试

1、单选题:

The element is inserted first and will be removed last in  _____________.
A:   linked list

B:   none of the above

C:   queue

D:   stack

正确答案:【   stack

2、单选题:

The expression 1 * 2 ^ 3 * 4 ^ 5 * 6 is evaluated as (^ is for power, as in a^b=ab):
A:    173458

B:    49152

C:    32^30

D:    162^30

正确答案:【    49152

3、单选题:

The data structure required to check whether an expression contains balanced parenthesis is?
A:    Stack

B:    Queue

C:    Tree

D:    Array

正确答案:【    Stack

4、单选题:The postfix form of A*B+C/D is?
A:    AB*CD/+

B:    A*BC+/D

C:    ABCD+/*

D:    *AB/CD+

正确答案:【    AB*CD/+

5、单选题:Which data structure is needed to convert infix notation to postfix notation?
A:    Branch

B:    Queue

C:    Tree

D:    Stack

正确答案:【    Stack

6、单选题:

Transform the following infix expression to prefix form.

((C*2)+1) /(A+B)
A:    / + * C 2 1 + A B

B:    A B + 1 2 C * + /

C:    None of the above

D:    / * + 1 2 C A B +

正确答案:【    / + * C 2 1 + A B

7、单选题:

Transform the following infix expression to postfix form.

(A+B) * (C-D)/E
A:    A B + C D – * E /

B:    A B + C D * – / E

C:    A B * C + D / –

D:    A B C * C D / – +

正确答案:【    A B + C D – * E /

8、单选题:A stack is a data structure in which all insertions and deletions are made respectively at:
A:    both the ends

B:   in the middle

C:    one end

D:    at any position

正确答案:【    one end

9、单选题:Which of the following applications may use a stack?:
A:    A parenthesis balancing program

B:    All of the above

C:    Syntax analyzer for a compiler

D:    Keeping track of local variables at run time

正确答案:【    All of the above

10、单选题:

Which of the following statement is correct.
A: A postfix expression is merely the reverse of the prefix expression

B: None of the above

C: A postfix expression is not the reverse of the prefix expression

D: Postfix and prefix expressions use parenthesis

正确答案:【 A postfix expression is not the reverse of the prefix expression

第四章 单元测试

1、单选题:A queue is a data structure in which all insertions and deletions are made respectively at:
A:    front and front

B:    front and rear

C:    rear and rear

D:    rear and front

剩余章节答案支付后查看
如有疑问请及时联系QQ 50895809反馈
如遇卡顿看不了剩余内容请换个浏览器即可打开

没找到的科目也可以提醒我们更新

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注