Question 1
Given the programming constructs
i) assignment
ii) for loops where the loop parameter cannot be changed within the loop
iii) if-then-else
iv) forward go to
v) arbitrary go to
vi) non-recursive procedure call
vii) recursive procedure/function call
viii) repeat loop,
which constructs will you not include in a programming language such that it should be possible to program the terminates (i.e. halting) function in the same programming language.
ii), iii), iv)
v), vii), viii)
vi), vii), viii)
iii), v), viii)
Question 2
Question 3
int Trial (int a, int b, int c)
{
if ((a >= b) && (c < b) return b;
else if (a>=b) return Trial(a, c, b);
else return Trial(b, a, c);
}
The function Trial:Question 4
(M) Tn=Tn−1+n (U) Tn=O(n) (N) Tn=Tn/2 +n (V) Tn=O(nlogn) (O) Tn=Tn/2 +nlogn (W) T=O(n^2) (P) Tn=Tn−1 +logn (X) Tn=O(log^2n)
Question 5
Question 6
A sorting technique is called stable if:
It takes O(n*log(n)) time
It maintains the relative order of occurrence of non-distinct elements
It uses divide and conquer paradigm
It takes O(n) space
Question 7
Question 8
If one uses a straight two-way merge sort algorithm to sort the following elements in ascending order 20, 47, 15, 8, 9, 4, 40, 30, 12, 17 then the order of these elements after the second pass of the algorithm is:
8, 9, 15, 20, 47, 4, 12, 17, 30, 40
8, 15, 20, 47, 4, 9, 30, 40, 12, 17
15, 20, 47, 4, 8, 9, 12, 30, 40, 17
4, 8, 9, 15, 20, 47, 12, 17, 30, 40
Question 9
A. Thread 1. Interrupt B. Virtual address space 2. Memory C. File system 3. CPU D. Signal 4. Disk
Question 10
There are 70 questions to complete.