The solution to this problem is incorrect. According to the previous page, you compare each subsequent element with existing elements from right to left, not from left to right. It takes one comparison to place the King and two for each of the remaining three cards. The total is 7, not 9.
I'm posting this under Logic since Intro to Algorithms is not listed among the available topics.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
No explanations have been posted yet. Check back later!