08.01.2023 Views

Learn to Program with C_ Learn to Program using the Popular C Programming Language ( PDFDrive )

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 9 ■ Searching, Sorting, and Merging

The top two cards are now 21 and 25. The smaller, 21, is removed and added to C, which now

contains 16 21. This exposes the number 28. We have this:

28 25

35 47

40 54

61

75

The top two cards are now 28 and 25. The smaller, 25, is removed and added to C, which now

contains 16 21 25. This exposes the number 47. We have this:

28 47

35 54

40

61

75

The top two cards are now 28 and 47. The smaller, 28, is removed and added to C, which now

contains 16 21 25 28. This exposes the number 35. We have this:

35 47

40 54

61

75

The top two cards are now 35 and 47. The smaller, 35, is removed and added to C, which now

contains 16 21 25 28 35. This exposes the number 40. We have this:

40 47

61 54

75

The top two cards are now 40 and 47. The smaller, 40, is removed and added to C, which now

contains 16 21 25 28 35 40. This exposes the number 61. We have this:

61 47

75 54

The top two cards are now 61 and 47. The smaller, 47, is removed and added to C, which now

contains 16 21 25 28 35 40 47. This exposes the number 54. We have this:

61 54

75

The top two cards are now 61 and 54. The smaller, 54, is removed and added to C, which now

contains 16 21 25 28 35 40 47 54. The list B has no more numbers.

272

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!