Mark As Completed Discussion

Let's look at some examples to see how the previous pseudo code works. We'll take a few simple scenarios and then build a more complex one.

Array: [30]

First we look at the following array with just one element (i.e. 30).

A Few Examples

Array: [31, 37, 38]

Now let's look at an array of size 3.

A Few Examples

Array: [10, 11]

Let us now go for an even sized array with two elements.

A Few Examples

Array: [10, 11, 17, 19]

We can now extend the example to an even sized array with four elements.

A Few Examples

Array: [10, 11, 17, 19, 30, 31, 37, 38]

An even sized array with eight elements.

A Few Examples