Test Simulator
Test Simulator
MeSH Edu I
7. Which method of the following does Clear the stack?
A) clear()
B) push()
C) pop()
D) topEl()
8. Which method of the following does Check to see if the stack is
empty?
A) Clear()
B) isEmpty()
C) push()
D) All Answer is Correct
9. Which method of the following does Return the topmost element
in the stack without removing it?
A) topEl()
B) isEmpty()
C) pop()
D) push()
10.What is worst case in Insertion Sort?
A) O(1)
B) O(n)
C) O(n2)
D) A & B
11.What is best case in Insertion Sort?
A) O(1)
B) O(n)
C) O(log(n))
D) O(n2)
MeSH Edu II
13. What type of Data Sturucter do we use with Recursion?
A) Array List
B) Singly Linked List
C) Doubly Linked List
D) Stack
14. In Tree Terminologies A node's level is the number of edges along
the unique path between it and the root node. The level of the
root node is?
A) 0
B) 1
C) 2
D) 3
15.The empty tree is a legitimate tree of height is?
A) 3
B) 2
C) 1
D) 0
16.public static void main(String[] args) {
int n = 5;
int result = factorial(n);
System.out.println("The factorial of " + n + " is: " + result);}
public static int factorial(int n) {
if (n == 0 || n == 1) {
return 1;
} else {
return n * factorial(n - 1);}}
What is result of this?
A) 30
B) 60
C) 90
D) 120
MeSH Edu IV
(Question Two Fill in the blanks)
1. A ………….. is a way of organizing data so that it can be used
effectively.
2. …………….. is the logical picture of the data and the operations to
manipulate the elements of the data.
3. Java’s …………….. is a useful language mechanism for processing an
abstract data.
4. To compare the efficiency of algorithms, a measure of the degree
of difficulty of an algorithm called ……………………..
5. The factor of …………… is usually more …………….. than that of space
6. If a node has a link only to its successor in the sequence of
nodes,the list is called a …………………….
7. A node includes two data fields: ……………. and ………………… .
8. The first node is always used as a reference to traverse the list and
is called…………….. .
9. The last node points to……………….
10. ………. and ………… operations have to be implemented as
operating methods on the stack
11. A queue is an ……………….. structure
12. ………… is the process of looking for a specific element in an array
13. The time complexity of this algorithm is ………………………
14. The best case insertion sort …………….
15. The worst case insertion sort ……………
16. The best case Selection sort ……………..
17.The Worst case Selection sort ……………..
18.The best, average and worst case Bubble sort ……………..
19.a function (let say fun) is called ……………… if it calls another
20. The best case Quick Sort ……………
21.The Worst case Quick Sort ……………
22. The Worst Case Merge Sort ……………….
23. The ………………… of a node is defined as the number of its children
24. The ……………… of a node is the length of the longest path from to
a leaf.
25. The ……………… of a nonempty tree is the maximum level of a node
in the tree. It is also the height of the root node in the whole tree.
MeSH Edu V
(Question Three short answers)
D) for(int i=1;i<=n;i++)
for(int j=1;j<=n;j=j*2)
System.out.println(i+j);
E) for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++)
System.out.println(i+j);
MeSH Edu VI
(Question Four Long answers)
A) Depth E?
B) Level E?
C) Degree E?
D) Paht Length E?
E) Height E?
F) Depth L?
G) Level L?
H) Degree L?
I) Path Length L?
J) Height L?
8. Choose any Two tree you want and fill out the following table
- Type of Tree ……………..
Type Tree Max Nodes Min Nodes Min height Max height
MeSH Edu IX
9. Write the name of the tree
A)
B)
MeSH Edu X
11. Building a B-tree of order 5 with the BTreeInsert() algorithm.
A) Insert 8, 14, 2, 15
B) Insert 3
C) Insert 1,16,6,5
D) Insert 27,37
E) Insert 18,25,7,13,20
F) Insert 22,23,24
MeSH Edu XI
12. Run DIJKSTRA’S ALGORITHM and find the shortest path from node
A to node F.