Commit 3300b91
authored
Updating comment.
The complexity of the original code was 0( n x m) because for every item in the first_sequence was compared against every item in second_sequence.
With the new implementation the time complexity is 0(n + m), because one iteration is made to build second_set; then another iteration through first_sequence.1 parent 3eadae1 commit 3300b91
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
0 commit comments