mirror of
https://github.com/dholerobin/Lecture_Notes.git
synced 2025-07-01 13:06:29 +00:00
Update 2Run.md
This commit is contained in:
parent
1acdebdba5
commit
629d2b6df2
@ -2,7 +2,7 @@
|
||||
|
||||
Run is an ordered(sorted) sub-array. It can be non-decreasing or decreasing. The input array is to be split into Runs.
|
||||
|
||||

|
||||

|
||||
|
||||
Below is a structure for Run.
|
||||
```cpp
|
||||
@ -60,19 +60,19 @@ In the case of a decreasing run, we reverse the list in the end.
|
||||
|
||||
For a given array `13 9 5 4 10 14 16`, let's find runs.
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
Now, we have found a run `4 5 9 13`. Similarly, next run `10 14 16` is already ascending, so no need to reverse it.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user