Question
A spy is 1.8 km ahead of an agent who begins to chase him.
The agent runs at a speed of 12 m/s, while the spy runs at 8 m/s. How much time will the agent take to catch the spy?Solution
ATQ,
Relative speed = 12 – 8 = 4 m/s
Distance = 1.8 × 1000 = 1800 metres
Required time = (1800 / 4) = 450 seconds = (450 / 60) = 7.5 minutes
Which algorithm guarantees minimum spanning tree and will produce a different tree depending on tie-breaking?
Which of the following is NOT a divide-and-conquer algorithm?
Which data structure gives amortized O(α(n)) time for union and find operations, where α is inverse Ackermann?
Which of the following sorting algorithms is considered stable (i.e., preserves the relative order of equal elements)?
In the context of searching, what is the primary advantage of using hashing?
Output of below code
public class Prg {
public static void main(String args[]){
System.out.print("A" + "B" + 'A');
}
...A directed acyclic graph (DAG) has 10 vertices and 15 edges. What is the maximum possible number of topological orderings?
Which shortest-path algorithm is appropriate for graphs with non-negative weights and supports decrease-key efficiently for faster performance?
In mobile computing, what is the main feature of pervasive computing?
Consider the following Python code snippet for binary search:
  def binary_search(arr, target):
    low = 0
    ...