Skip to Main Content
Students' Guide to Program Design
book

Students' Guide to Program Design

by Lesley Anne Robertson
May 2014
Intermediate to advanced content levelIntermediate to advanced
188 pages
7h 8m
English
Newnes
Content preview from Students' Guide to Program Design
APPENDIX
This appendix contains a number of algorithms which are not included
in the body of the textbook and yet may be required at some time in a
programmer's career.
The first three algorithms are sorting algorithms, viz bubble sort,
insertion sort and selection sort. Then follow five algorithms which
manipulate the elements of an array.
1 Sorting algorithms
1.1 Bubble sort algorithm
This algorithm sorts an integer array into ascending order using a
bubble sort method.
The algorithm, on each pass, compares each pair of adjacent items
in the array. If the pair is out of order they are switched, otherwise they
will remain in the original order ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick

Publisher Resources

ISBN: 9781483141442