BCS Bachelor of Computer Science Degree 3 ā Questions and Answers
Question 1: What is the worst-case time complexity of searching in a balanced Binary Search Tree (BST)?
- O(1)
- O(log n) (Correct answer)
- O(n)
- O(n²)
Correct answer: O(log n)
A balanced BST guarantees O(log n) worst-case search time because the tree height is kept at log n.
Question 2: In object-oriented programming, what concept allows a subclass to provide a specific implementation of a method already defined in its parent class?
- Overloading
- Overriding (Correct answer)
- Encapsulation
- Abstraction
Correct answer: Overriding
Method overriding allows a subclass to redefine a parent class method with its own specific implementation.
Question 3: Which type of memory is volatile and loses its content when power is removed?
- ROM
- Flash Memory
- RAM (Correct answer)
- SSD
Correct answer: RAM
RAM (Random Access Memory) is volatile and loses all stored data when the power supply is cut.
Question 4: In asymptotic notation, O(1) describes what type of algorithm complexity?
- Linear
- Logarithmic
- Quadratic
- Constant (Correct answer)
Correct answer: Constant
O(1) denotes constant time complexity, meaning execution time does not change regardless of input size.
Question 5: Which cryptographic protocol is used to secure communications over a computer network in HTTPS?
- SSH
- TLS/SSL (Correct answer)
- FTP
- SMTP
Correct answer: TLS/SSL
TLS (Transport Layer Security), formerly SSL, encrypts data transmitted over HTTPS connections.
Question 6: In the context of operating systems, what is a deadlock?
- A process running indefinitely without producing output
- A situation where two or more processes are waiting for each other to release resources (Correct answer)
- A kernel crash caused by a hardware failure
- A race condition in multithreaded code
Correct answer: A situation where two or more processes are waiting for each other to release resources
A deadlock occurs when two or more processes are each waiting for the other to release a resource, halting all progress.
Question 7: What is the primary purpose of a compiler in the software development process?
- To execute source code line by line at runtime
- To translate high-level source code into machine code (Correct answer)
- To manage memory allocation during program execution
- To debug and profile application performance
Correct answer: To translate high-level source code into machine code
A compiler translates entire high-level source code into machine code before program execution.
What is the worst-case time complexity of searching in a balanced Binary Search Tree (BST)?