Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion C02-Getting-Started/problem.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ elements in Θ(n lg n) worst-case time. (Hint: Modify merge sort.)

### `Answer`
**a.**
2,1⟩, ⟨3,1⟩, ⟨8,6⟩, ⟨8,1⟩ 和 ⟨6,1⟩.
1,5⟩, ⟨2,5⟩, ⟨3,4⟩, ⟨3,5⟩ 和 ⟨4,5⟩.

**b.** The array with decending order arrangement i.e. {n, n-1, n-2, ..., 3, 2, 1} has the most inversions.
Number of inversions = Number of ways to choose two distinct element from the above set = n(n-1)/2.
Expand Down