August 2024
Intermediate to advanced
516 pages
11h 47m
English
The ordered array is almost identical to the classic array we saw in the previous chapter. The only difference is that ordered arrays require that the values are always kept—you guessed it—in order; that is, every time a value is added, it gets placed in the proper cell so that the values in the array remain sorted.
For example, let’s take the array [3, 17, 80, 202]:

Assume we want to insert the value 75 into the array. If this array were a classic array, we could insert the 75 at the end, as follows:

As we saw in the previous chapter, ...
Read now
Unlock full access