ProgrammingVery hard
What is the Levenshtein edit distance between "kitten" and "sitting" (insert, delete, replace, each cost 1)?
- A. 2
- B. 3
- C. 4
- D. 5
Correct answer: B. 3
Replace k with s, replace e with i, and insert g. Three operations are needed and fewer are not possible.
More C Programming questions
- A 5 x 7 int matrix is stored in row-major order. What is the flat offset of the cell at 1-based row 3, column 4?
- On a 4 x 4 grid, a robot moves only right or down from (0,0) to (3,3) and may not enter cell (1,1). How many routes are there?
- Which parameter declaration accepts an int a[3][4] argument from main without a warning?
- On an n x n grid with n = 4, how many cells lie on at least one of the two main diagonals?
- int a[2][2] = {1, 2, 3, 4}; What is a[1][0]?
- int a[2][3]; What is sizeof(a[1]) on a platform with 4-byte int?