第一章 单元测试
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
答案: 【
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
答案: 【
3、单选题:
The data structure required to check whether an expression contains balanced parenthesis is?
选项:
A: Stack
B: Queue
C: Tree
D: Array
答案: 【
】
4、单选题:
The postfix form of A*B+C/D is?
选项:
A: AB*CD/+
B: A*BC+/D
C: ABCD+/*
D: *AB/CD+
答案: 【
】
5、单选题:
Which data structure is needed to convert infix notation to postfix notation?
选项:
A: Branch
B: Queue
C: Tree
D: 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 +
答案: 【
】
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 / – +
答案: 【
】
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
答案: 【
】
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
答案: 【
】
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
答案: 【
】
第四章 单元测试
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
答案: 【
】
2、单选题:
The following data structure is used for scheduling of jobs during batch processing in computers.
选项:
A: stack
B: linked list
C: tree
D: queue
答案: 【
】
3、单选题:
In a queue the deletions are take place at_________.
选项:
A:top
B:None of the above
C:front
D:
rear
答案: 【
】
4、单选题:
In a queue the insertions are take place at_________.
选项:
A:front
B:top
C:None of the above
D:rear
答案: 【
】
5、单选题:
In circular queue, the front will always point to one position __________from the first element in the queue.
选项:
A:counterclockwise
B:right
C:clockwise
D:left
答案: 【
】
6、单选题:
Which of the following is not the type of queue.
选项:
A:circular queue
B:double ended queue
C:priority queue
D:single ended queue
答案: 【
】
7、单选题:
One of the advantage of circular queue is_____________.
选项:
A: easier computations
B: None of the above
C: effective use of memory
D: deleting elements based on priority
答案: 【
8、单选题:
What is the time complexity of a linear queue having n elements?
选项:
A: O(nlog n)
B: O(1)
C: O(log n)
D: O(n)
答案: 【
】
9、单选题:
What is a dequeue?
选项:
A:A queue with insert/delete defined for both front and rear ends of the queue
B:A queue with insert/delete defined for front end of the queue
C:A queue implemented with both singly and doubly linked list
D:A queue implemented with a doubly linked list
答案: 【
】
10、单选题:
One difference between a queue and a stack is:
选项:
A:Queues require dynamic memory, but stacks do not.
B:Queues use two ends for adding and deleting, but stacks use one.
C:Stacks require dynamic memory, but queues do not.
D:Stacks use two ends for adding and deleting, but queues use one.
答案: 【
】
第五章 单元测试
1、单选题:
A linear list of data elements where each element called node is given by means of pointer is called
选项:
A: stack
B: node list
C: linked list
D: queue
答案: 【
】
2、单选题:
Consider an implementation of unsorted singly linked list. Suppose it has representation which a head pointer only. Given the representation, which of the following operation can be implemented in O(1) time?
(I). Insertion at the front of the linked list.
(II). Insertion at the end of the linked list.
(III). Deletion of the front node of the linked list.
(IV). Deletion of the last node of the linked list.
选项:
A:I, II, and IV
B:I and II
C:I, II, and III
D:I and III
答案: 【
】
3、单选题:
What is the time complexity to count the number of elements in the linked list?
选项:
A:O(n2)
B:O(n)
C:O(log n)
D:O(1)
答案: 【
】
4、单选题:
In which of the following linked lists there are no NULL links?
选项:
A: Circular linked list
B: None of the above
C: Doubly linked list
D: Singly linked list
答案: 【
】
5、单选题:
In doubly linked lists, traversal can be performed?
选项:
A: Only in forward direction
B: None
C: Only in reverse direction
D: In both directions
答案: 【
】
6、单选题:
What kind of list is best to answer questions such as : “What is the item at position n?”
选项:
A: Singly-linked lists
B: None of the above
C: Doubly-linked lists
D: List implemented with an array
答案: 【
】
7、单选题:
In a singly linked list which operation depends on the length of the list.
选项:
A: Add an element before the first element of the list
B: Interchange the first two elements of the list
C: Delete the first element of the list
D: Delete the last element of the list
答案: 【
】
8、单选题:
The link field in a node contains:
选项:
A: address of the next node
B: data of current node
C: data of previous node
D: data of next node
答案: 【
】
9、单选题:
Linked list data structure offers considerable saving in:
选项:
A: Computational time
B: None of the above
C: Space utilization
D: Space utilization and computational time
答案: 【
】
10、单选题:
A linear list in which each node has pointers to point to the predecessor and successors nodes is called as:
选项:
A: Linear linked list
B: Circular linked list
C: Singly-linked lists
D: Doubly-linked lists
答案: 【
】
第六章 单元测试
1、单选题:
To represent hierarchical relationship between elements, which data structure is suitable?
选项:
A: queue
B: stack
C: tree
D: array
答案: 【
】
2、单选题:
What is the maximum number children that a binary tree node can have?
选项:
A:0
B:2
C:3
D:1
答案: 【】
3、单选题:
The inorder traversal of tree will yield a sorted listing of elements of tree in
选项:
A: Heaps
B: Binary search trees
C: None of the above
D: Binary trees
答案: 【
】
4、单选题:
If we store the nodes of a binary tree in an array with index starting from zero, the right child of a node having index n can be obtained at:
选项:
A:2n+2
B:n+1
C:2n+1
D:(n-1)/2
答案: 【
】
5、单选题:
Which of the following traversal outputs the data in sorted order in a BST?
选项:
A: Postorder
B: Preorder
C: Level order
D: Inorder
答案: 【
】
6、单选题:
To obtain a prefix expression, which of the following traversals is used?
选项:
A: Preorder
B: Level order
C: Postorder
D: Inorder
答案: 【
】
7、单选题:
The maximum number of nodes in a tree for which postorder and preorder traversals may be equal to is _______ .
选项:
A:1
B:3
C:0
D:2
答案: 【】
8、单选题:
Suppose the numbers 7, 5, 1, 8, 3, 6, 0, 9, 4, 2 are inserted in that order into an initially empty
Binary Search Tree. The Binary Search Tree uses the usual ordering on natural numbers. What is the inorder traversal sequence of the resultant tree?
选项:
A: 9 8 6 4 2 3 0 1 5 7
B: 0 2 4 3 1 6 5 9 8 7
C: 0 1 2 3 4 5 6 7 8 9
D: 7 5 1 0 3 2 4 6 8 9
答案: 【
9、单选题:
A full binary tree is a tree where________________.
选项:
A:each node has exactly zero or two children.
B:each node has exactly one or two children.
C:
each node has exactly two children
D:all the leaves are at the same level.
答案: 【
】
10、单选题:
A complete binary tree is a tree where________________.
选项:
A:each node has exactly one or two children
B:every level of the tree is completely filled except the last level
C:
each node has exactly zero or two children
D:each node has exactly two children
答案:
】
请先
!