
Insertion sort
The algorithm is basically designed to organize and sort the array or list of elements in specific manner, that enables the system and user to get the final sorted array or a list of elements.
Generally, it prepares a new array or list and then starts inserting elements in its appropriate position by following specific manner in this new list. This new list is known as sorted list.
Example:
- 1. Developing a phonebook contact list by sorting the names alphabetically.
- 2. Sorting a list of integers numerically, etc.
Selection sort:
It is a simple sorting algorithm which basically specifies the manner in which a list or array should be sorted. Generally, each time it finds the minimum elements from the unsorted array and then positions them in an appropriate form or ascending order.
Each time after finding the minimum or smallest element it swaps the element with the leftmost element.

Want to see the full answer?
Check out a sample textbook solution
Chapter 5 Solutions
EBK COMPUTER SCIENCE: AN OVERVIEW
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr




