1. Who founded Python?
Answer:
d. The idea of Python was conceived by Guido van Rossum in the later 1980s.
2. What is the type of programming language supported by Python?
Answer:
d. Python is an interpreted programming language, supporting object-oriented, structured, and functional programming.
3. Which among the following is the queue data structure’s applications?
Answer:
4 All the above as all these features are the applications of queue type of data structure
4. What is the time complexity of finding an element in a Python list using the **in**
operator?
Answer:
A. O(n)
Explanation: The **in**
operator in Python performs a linear search in a list, resulting in a time complexity of O(n) in the worst case.
5. Which sorting algorithm has the best average-case time complexity in Python?
Answer:
A. Quick Sort
Explanation: Quick Sort has an average-case time complexity of O(n log n), which makes it more efficient on average compared to the other sorting algorithms listed.
6. What is the worst-case time complexity of the binary search algorithm in a sorted list of size n?
Answer:
A. O(log n)
Explanation: Binary search has a worst-case time complexity of O(log n) because it divides the search space in half with each comparison.
7. Which algorithm is used to find the shortest path in a weighted directed graph with non-negative weights?
Answer:
C. Dijkstra's algorithm
Explanation: Dijkstra's algorithm is used to find the shortest path in a weighted graph with non-negative weights.
8. Which database term is used to describe the rules that govern the relationships between tables in a relational database?
Answer:
D. Constraints
Explanation: Constraints in a relational database define rules and relationships between tables, such as primary keys, foreign keys, and unique constraints.
9. Which type of join returns only the rows that have matching values in both tables being joined?
Answer:
A. INNER JOIN
Explanation: INNER JOIN returns only the rows with matching values in both tables.
10. In a relational database, what does ACID stand for?
Answer:
A. Atomicity, Consistency, Isolation, Durability
Explanation: ACID stands for Atomicity, Consistency, Isolation, and Durability, which are properties that ensure the reliability of database transactions.
Top Tutorials
Related Articles