16 Algorithms (Computer Science) questions asked in CIL MT previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.
During a content search operation in associative memory, which register temporarily holds the key used to compare against all stored memory words simultaneously?
A logistics company manages a tracking system where each package ID is stored in a chronological list as the packages are processed. An engineer suggests that, to locate a particular package's ID, the system should check each ID sequentially from the start until the target is found or the list ends. Which statement most accurately reflects the main drawback of this approach if the company expects the number of packages to increase dramatically over time?
AFinding a package ID will become faster as the number of packages increases.
BSearch time grows linearly with the number of packages.
CThe time to search for any package ID will stay about the same, regardless of list size.
DThe memory needed to store package IDs will remain constant even as the list grows.
Show answerHide answer
Correct answer: (B) Search time grows linearly with the number of packages.
A list of n-1 integers is provided, where each integer is in the range of 1 to n, and there are no duplicates. One integer is missing from the list. What is the time and space complexity if we apply a brute force algorithm to find the missing integer?
Consider the list of numbers 1, 2, 3, …, 1000 is stored in a[0..999]. What will be the total number of comparisons to search x = 501 using the following binary search() function?
int binary_search(int a[], int n, int x){ int low=0, high=n-1;
while(low <= high){ int m = (low + high) / 2;
if(x > a[m]) low = m + 1;
else if(x < a[m]) high = m − 1;
else return m;
}
return -1;
}
In order to sort list of numbers using radix sort algorithm, we need to get the individual digits of each number 'n' of the list. If n is a positive decimal integer, then iᵗʰ digit, from right, of the number n is:
The multiplicand register and multiplier register of hardware circuit implementing Booths algorithm have (11101) and (1100). The result shall be:
A812 (decimal)
B−812 (decimal)
C−12 (decimal)
D12 (decimal)
Show answerHide answer
Correct answer: (A) 812 (decimal)
How to use these CIL MT Computer Science questions
Every question here was asked in a real CIL MT paper; the paper and shift are shown on the card, and the number opens the question on its own page. Try each one before tapping Show answer, then attempt the full CIL MT papers as timed tests to check your speed under exam conditions.