Data Structures & AlgorithmsModerateGATE CS · TCS NQT

The substitutions-only distance (Hamming distance) between "karolin" and "kathrin" counts positions where the letters differ. What is that value?

  1. A. 0
  2. B. 5
  3. C. 3
  4. D. 14

Correct answer: C. 3

Hamming distance compares letters position by position and only works for equal lengths. Edit distance allows insertions and deletions, so it can be smaller or larger; LCS-based counts measure a different quantity.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic