Data Structures & AlgorithmsModerateICPC regional · geometry
Problem: What does the cross product of two 2D vectors (a, b) and (c, d) equal?
- A. ad - bc
- B. ac + bd
- C. a + b + c + d
- D. ab - cd
Correct answer: A. ad - bc
The 2D cross product is the determinant ad - bc, whose sign gives the turn direction.
More Coding Interview Problems questions
- Problem: Which approach finds the k-th lexicographically smallest substring of a string?
- Problem: What is the expected number of distinct values when n balls are thrown uniformly into n bins?
- Problem: Which algorithm is the standard way to find the minimum number of swaps to sort a permutation?
- Problem: What is the complexity of binary exponentiation for computing a^b mod m?
- Problem: What property of an array makes the two-pointer technique for pair sums valid?
- Problem: What is the purpose of a 'segment tree beats' structure?