The worst-case time complexity of quicksort is ___________.
- O(1)
- O(n log n)
- O(n)
- O(n^2)
Quicksort's worst-case time complexity is ?(?2)O(n2), occurring when the pivot selection consistently results in unbalanced partitions, leading to many recursive calls and inefficient sorting, especially for sorted or nearly sorted data.
DNS primarily works on the ___________ protocol.
- HTTP (Hypertext Transfer Protocol)
- ICMP (Internet Control Message Protocol)
- TCP (Transmission Control Protocol)
- UDP (User Datagram Protocol)
DNS (Domain Name System) primarily operates over UDP (User Datagram Protocol) for its query and response mechanism due to its low overhead and efficiency in real-time communication.
The process of dynamically adjusting transmission power levels to maintain a stable connection in wireless networks is known as ___________.
- Adaptive Modulation
- Channel Optimization
- Dynamic Scaling
- Power Adaptation
Adaptive Modulation refers to the technique of dynamically adjusting transmission parameters, such as power levels, to optimize performance and maintain stable connections in wireless networks.
What is the time complexity of accessing an element in an array?
- O(1)
- O(n)
- O(log n)
- O(n log n)
Option 1, O(1), represents constant time complexity. Accessing an element in an array by its index takes the same amount of time, regardless of the array size. Hence, it is independent of the array's size, resulting in constant time complexity.
How does roaming work in wireless networks, and what role does it play in maintaining connectivity for mobile devices?
- Allows devices to switch between access points without losing connection
- Facilitates seamless connectivity while moving between different networks
- Maintains session continuity by transferring data packets between access points
- Uses signal strength to determine the best access point for connection
Roaming enables devices to switch between access points without losing connectivity, crucial for maintaining seamless connections as mobile devices move between different areas or networks.
What is the difference between Waterfall and Agile methodologies in terms of adaptability to change?
- Agile encourages adaptive planning and
- Agile methodology is iterative and flexible,
- Waterfall focuses on comprehensive upfront
- Waterfall methodology is linear and rigid,
Waterfall methodology follows a sequential approach where each phase must be completed before moving to the next, making it less adaptable to change. In contrast, Agile methodology promotes iterative development, continuous feedback, and changes in requirements, enabling better adaptability and responsiveness to change.
The ___________ step in dynamic programming involves breaking down the problem into smaller subproblems.
- Analysis
- Decomposition
- Design
- Synthesis
Decomposition is a critical step in dynamic programming where a complex problem is broken down into smaller, more manageable subproblems. This allows for the application of dynamic programming techniques, such as memoization or tabulation, to solve the problem efficiently.
To prevent SQL injection attacks, web applications should use ___________ statements or parameterized queries.
- Dynamic SQL
- Escaped Input
- Prepared Statements
- Sanitized Input
SQL injection is a type of cyber attack where malicious SQL code is inserted into input fields of a web application, allowing attackers to access and manipulate the database. Using prepared statements or parameterized queries is an effective defense against SQL injection because they allow the database to distinguish between code and data, preventing attackers from executing arbitrary SQL commands. Sanitizing input and using escaped input are also good practices but may not provide as robust protection as prepared statements.
Dynamic programming can be categorized into two main types: ___________ and ___________.
- Bottom-Up
- Iterative
- Recursive
- Top-Down
Dynamic programming can be broadly categorized into bottom-up (iterative) and top-down (recursive) approaches. Bottom-up DP starts from solving the smallest subproblems and builds up to the main problem, while top-down DP starts from the main problem and recursively solves smaller subproblems.
Which SQL clause is used to filter records in a SELECT statement?
- FILTER
- GROUP BY
- HAVING
- WHERE
The SQL clause used to filter records in a SELECT statement is the WHERE clause. It allows you to specify conditions that the rows must meet to be included in the result set. This is essential for retrieving specific data based on criteria such as values in certain columns or combinations of conditions.