Sample Questions

<Sample questions>


Ans: (4) Selection sort. Selection sort is an in-place algorithm having the minimum number of swaps.


Ans: 60. (30 * 0.8) + ((30 + 150) * 0.2) = 60


Ans: 3 NAND gates are required in minimum to implement OR gate.




Answer: 1 is True and 2 and 3 are False.


Answer: 1 is True and 2 and 3 are False.

Solution: 1. Throughput is only affected by a clock cycle, 2. Latency is defined by (# stages) * (longest stage time). For example, M-5's latency is 5 * (longest stage time) and M-7's latency is 7 * (longest stage time). 3. This is obviously false.



Answer: 1 is True and 2 and 3 are False.


Answer: 1

Solution: the ability of cache controllers to observe the activity on the bus and take appropriate actions are called snoopy-cache technique. For performance reasons, it is important that the snooping function does not interfere with the normal operation of a processor and its cache.


Answer: 1 is True and 2 and 3 are False.



Answer: Infinite, but possibly decidable and possibly undecidable

Solution: Decidable language can be finite or infinite. Undecidable language is always infinite. 


Answer: P1 can be solved in polynomial time but P2 is not known to be solvable in polynomial time (NP-complete problem이라고 알려짐. However, an exception is made for DAG. The longest path in a DAG can be solved in linear time.)


Answer: 1 and 3 are True and 2 is False.


Answer: 2