What is the time complexity of a binary search on a sorted array?
- O(1)
- O(log n)
- O(n log n)
- O(n)
Binary search has a time complexity of O(log n) on a sorted array. It efficiently narrows down the search space with each comparison, making it a highly efficient algorithm for searching.
Loading...
Related Quiz
- An organization is deploying a secure system where users must prove their identity without revealing any other unnecessary information. Which cryptographic concept allows for this selective disclosure of information?
- The _______ is a protocol stack used in IoT to facilitate device-to-device, device-to-server, and server-to-server communication.
- A project's _______ defines the work that needs to be accomplished to deliver a product, service, or result with the specified features and functions.
- Which wireless networking technology is optimized for low power usage and short-range communications, often used in wearable devices?
- What type of attack involves overwhelming a target with a flood of internet traffic, rendering it inaccessible?