Computer — All MCQs
4795 questions available
Q2401.What is the space complexity of the HeapSort algorithm?
Correct Answer: A
Heap Sort is an in-place sorting algorithm, requiring constant auxiliary space, O(1).
Q2402.The characteristics of a suitable set of normalized relations include all of these EXCEPT?
Correct Answer: C
Normalization is a relational database concept. Method overriding is an object-oriented programming concept, not related to database normalization.
Q2403.What is the space complexity of the Quicksort algorithm?
Correct Answer: A
Quick Sort has an average auxiliary space complexity of O(log n) due to the call stack of its recursive partitioning.
Q2404.In Tuple Relational Calculus, to express the query "Find the set of all tuples S such that F(S) is true", how can we write this?
Correct Answer: C
Tuple Relational Calculus uses the set notation {S | F(S)} to represent all tuples S that satisfy the predicate formula F(S).
Q2405.Which of the following is the Best Case Time Complexity of the Bubble Sort algorithm?
Correct Answer: A
An optimized Bubble Sort (using a flag to detect if any swaps occurred) has a best-case time complexity of O(n) when the input array is already sorted.
Q2406.Which of the underlying network is a network with a size between a LAN and a WAN, normally covering a town or city?
Correct Answer: C
A MAN (Metropolitan Area Network) covers a geographical area larger than a LAN but smaller than a WAN, typically spanning a city.
Q2407.A DFA (deterministic finite automata) is defined by a quintuple (5-tuple) as (Q, Σ, δ, q0, F). Where δ = ______?
Correct Answer: C
In DFA, δ (delta) is the transition function mapping Q x Σ -> Q, defining the state transition based on input.
Q2408.What are the advantages of compiled languages?
Correct Answer: C
Compiled languages are translated to machine code before execution, making their execution speed significantly faster than interpreted languages.
Q2409.Which of the following is the Best Case Time Complexity of the Quicksort algorithm?
Correct Answer: C
Quick Sort achieves its best-case time complexity of O(n log n) when the partitioning is balanced (the pivot splits the array into roughly equal halves).
Q2410.Which of the following is an Implementation of dynamic arrays in C++?
Correct Answer: C
In C++, the std::vector class implements a dynamic array that can automatically grow and shrink in size.
Q2411.What is the space complexity of the merge sort algorithm?
Correct Answer: A
Merge Sort is not an in-place algorithm; it requires auxiliary arrays of size n during the merge phase, resulting in a space complexity of O(n).
Q2412.What is a Candidate Key in Database?
Correct Answer: A
A Candidate Key is a minimal set of attributes that uniquely identifies each tuple (record) in a relation. One of these candidate keys is chosen as the primary key.
Q2413.What is the time complexity of searching for an element in a balanced binary search tree?
Correct Answer: C
In a balanced Binary Search Tree (BST), the height is O(log n). Since each step of search eliminates half of the remaining subtrees, the search time complexity is O(log n).
Q2414.What is the worst case time complexity of a quick sort algorithm?
Correct Answer: C
Quick Sort has a worst-case time complexity of O(N^2), occurring when the pivot consistently partitions the array extremely unevenly (e.g., if the array is already sorted or reverse sorted).
Q2415.In which of the following facility, all of the work of thread management is done by the application and the kernel is not aware of the existence of threads?
Correct Answer: C
In User-Level Threads (ULT), all thread management is done by the application using a threads library. The kernel is unaware of these threads and schedules the process as a single unit.
Q2416.How are real numbers encoded to store in the computer?
Correct Answer: B
Real numbers (fractional numbers) are represented in computers using floating-point notation, typically following the IEEE 754 standard.
Q2417.Informally, an algorithm can be said to exhibit a growth rate on the order of a function f(n) if beyond a certain input size n, the function f(n) times a positive constant provides an upper bound or limit for the run-time of that algorithm. In other words, for a given input size n greater than some n0 and a constant c, the running time of that algorithm will never be larger than ______?
Correct Answer: A
c × f(n). This is describing Big O notation, where f(n) is the growth rate of the algorithm's runtime. The definition says: For n greater than some n₀, there exists a constant c > 0 such that runtime ≤ c × f(n), meaning the runtime is bounded above by c × f(n).
Q2418.Which government app is used to facilitate citizens for certificates, licenses, and other public services?
Correct Answer: B
E-Government apps are designed by government agencies to provide public services. Examples include the Pakistan Citizen Portal, Pak ID app, and e-Khidmat Markaz.
Q2419.Which cryptocurrency app allows P2P trading for Pakistani users?
Correct Answer: B
Binance P2P is the most popular and widely used P2P trading platform for Pakistani users, allowing trading via local payment methods such as bank transfers, EasyPaisa, and JazzCash.
Q2420.How to add a filter in Excel?
Correct Answer: B
Filters help display only the data you need in a table. To add a filter: Select your data → Data tab → Filter. Small dropdown arrows appear in the header row of your table.