Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lists in Python Selection Sort Algorithm. Sorting A very common activity for computers Not just in business, sorting is used in databases, graphics, simulations,

Similar presentations


Presentation on theme: "Lists in Python Selection Sort Algorithm. Sorting A very common activity for computers Not just in business, sorting is used in databases, graphics, simulations,"— Presentation transcript:

1 Lists in Python Selection Sort Algorithm

2 Sorting A very common activity for computers Not just in business, sorting is used in databases, graphics, simulations, games, etc. Many different algorithms for sorting – different ones are better for sorting data in different formats, environments, conditions Python has a sort algorithm builtin, for lists

3 So why learn a sort algorithm? Good exercise for manipulating lists Not all languages have one builtin Why selection sort? – one of the simpler algorithms – easy to debug if necessary

4 Selection sort for n elements (ascending) for n-1 passes find the largest value in unsorted part of list swap it with the value at the end of the unsorted part There are variations based on using smallest instead of largest, on descending instead of ascending


Download ppt "Lists in Python Selection Sort Algorithm. Sorting A very common activity for computers Not just in business, sorting is used in databases, graphics, simulations,"

Similar presentations


Ads by Google