SlideShare une entreprise Scribd logo
1  sur  83
2

Sorting Algorithms
Instructions

•

For the embedded lessons look for the Icon

Click on it to present embedded lessons
Lecture Objectives

•
•
•
•
•
•
•

Become aware of what is sorting.
Become aware of sorting algorithms.
Explore the types of sorting algorithms.
Learn about Bubble Sort.
Learn about Insertion Sort.
Learn about Selection Sort.
Learn about Merge Sort.
What is sorting?
Ascending or
descending order

Sorting = ordering.
Sorted = ordered based on a particular
way.

An operation that puts
(organizes) elements of a list
(a collection of data) into
certain order (ascending or
descending order).

3162134590
0112334569
9654332110
Sorting – formal definition
Permutation

Input:
A sequence of n numbers:
a1, a2, ..., an

Output:
A permutation (reordering):
ak1, ak2, ..., akn
of the input sequence such that
f(ak1) ≤ f(ak2) ≤... ≤ f(akn)
where f is an ordering function
Examples of Sorting
– Words in a dictionary are sorted.
– Files in a directory are often listed in sorted order.
– In a newspaper, the calendar of events in a schedule is generally
sorted by date.
– In a record store musical compact disks are generally sorted by
recording artist.
What is a Sorting Algorithm?
An algorithm for sorting a set of elements.

3162134590
0112334569
9654332110
Types of Sorting Algorithms
There are many, many different types of sorting algorithms,
but the primary ones are:
•
•
•
•
•
•

Bubble Sort
Selection Sort
Insertion Sort
Merge Sort
Quick Sort
Shell Sort
Selection Sort
One of the simplest
algorithms works as follows:

Name “selection sort” because it works by
repeatedly “selecting“ the smallest remaining
element and exchanging it with the i-th
element in i-th iteration.

sorting

– Find the smallest element and
exchange it with the element
in the first position
– Find the second smallest
element and exchange it with
the element in the second
position
– Continuing in this way until
the entire array is sorted.

Meaning of words
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

6

2
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

6

2
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

6

2
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

6

2
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

6

2
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

6

2
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

6

2
Selection Sort

5

1

3

4

6

Largest

Comparison
Data Movement
Sorted

2
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

2

6
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

2

6
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

2

6
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

2

6
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

2

6
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

2

6
Selection Sort

5

1
Comparison
Data Movement
Sorted

3

4

2

6
Selection Sort

5

1


Largest

Comparison
Data Movement
Sorted

3

4

2

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1

3

4

Largest

Comparison
Data Movement
Sorted

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1

3

Largest

Comparison
Data Movement
Sorted

4

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

2

1


Largest

Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

1

2
Comparison
Data Movement
Sorted

3

4

5

6
Selection Sort

1

2

3
DONE!

Comparison
Data Movement
Sorted

4

5

6
Selection sort

start

i:=1,n-1
min:=a(i)
ind:=i
for j:=i+1,n
a(j) < min

false

min:=a(j)
ind:=j

a(ind):=a(i)
a(i):=min
end

46
Code of selection sort
public static void selectionSort(int[]
{
int outer, inner, min;
for (outer = 0; outer < a.length
{
min = outer;
for (inner = outer + 1; inner <
{
if (a[inner] < a[min]) min =

a)
- 1; outer++)
a.length; inner++)
inner;}

// Invariant: for all i, if outer <= i <= inner, then
a[min] <= a[i]
// a[min] is least among a[outer]..a[a.length - 1]
int temp = a[outer];
a[outer] = a[min];
a[min] = temp;
// Invariant: for all i <= outer, if i < j then a[i] <=
a[j]
}
}
Insertion sort
1. We have two group of items:
–sorted group, and
–unsorted group

2. Initially, all items in the
unsorted group and the sorted
group is empty.
This method is often
used for playing cards (used by
people to sort bridge hands).

–We assume that items in the
unsorted group unsorted.
–We have to keep items in the
sorted group sorted.

3. Pick any item from, then insert
the item at the right position in
the sorted group to maintain
sorted property.
4. Repeat the process until the
unsorted group becomes empty.
Insertion sort
Like sorting a hand of playing cards:
–Start with an empty left hand and the
cards facing down on the table.
–Remove one card at a time from the
table, and insert it into the correct
position in the left hand
Compare it with each of the cards
already in the hand, from right to left.
–The cards held in the left hand are
sorted
These cards were originally the top cards
of the pile on the table.
Insertion sort

1. To insert 12, we need to
make room for it.

6 1 0 2 4 36

12
50
Insertion sort
10 24
6

2. Moving 36.

36

12
51
Insertion sort

6 10

3. Moving 24.

24 3
6

12
52
Insertion sort
0 12 24 36
6 1

4. Place 12 into right position.

53
Code for insertion sort

for(i=1; i<n; i++)
for(j=i; (j>0) && (a[j]>a[j-1]); j--)
{
pom=a[j];
a[j]=a[j-1];
a[j-1]=pom;
}
Insertion sort
with Romanian folk dance
Bubble sort
•

•

•

Compare each element (execept the last one) with its neighbor to the
right.
– If they are out of order, swap them.
– This puts the largest element at the very end.
– The last element is now in the correct and final place.
Compare each element (execept the last two) with its neighbor to the
right.
– If they are out of order, swap them.
– This puts the largest element at the very end.
– The last two elements is now in the correct and final place.
Compare each element (execept the last three) with its neighbor to the
right.
– Continue as above until you have no unsorted elements on the left.
Bubble sort

9, 6, 2, 12, 11, 9, 3, 7

Compares the numbers in pairs from left to right exchanging when
Compares the numbers in pairs from left to right exchanging when
necessary. The first number is compared to the second and as it is
necessary. The first number is compared to the second and as it is
larger they are exchanged.
larger they are exchanged.

6, 9, 2, 12, 11, 9, 3, 7
The next pair of numbers are compared. 9 is the larger and this pair is
The next pair of numbers are compared. 9 is the larger and this pair is
also exchanged.
also exchanged.

6, 2, 9, 12, 11, 9, 3, 7
In the third comparison, the 9 is not larger than the 12 so no exchange
In the third comparison, the 9 is not larger than the 12 so no exchange
is made. We move on to compare the next pair without any change to
is made. We move on to compare the next pair without any change to
the list.
the list.
Bubble sort

6, 2, 9, 12, 11, 9, 3, 7
The 12 is larger than the 11 so they are exchanged.
The 12 is larger than the 11 so they are exchanged.

6, 2, 9, 11, 12, 9, 3, 7
The 12 is greater than the 9 so they are exchanged
The 12 is greater than the 9 so they are exchanged

6, 2, 9, 11, 9, 12, 3, 7
The 12 is greater than the 3 so they are exchanged.
The 12 is greater than the 3 so they are exchanged.
Bubble sort

6, 2, 9, 11, 9, 3, 12, 7
The 12 is greater than the 7 so they are exchanged.
The 12 is greater than the 7 so they are exchanged.

The end of the list has been reached so this is the end of the first pass. The twelve
The end of the list has been reached so this is the end of the first pass. The twelve
at the end of the list must be largest number in the list and so is now in the correct
at the end of the list must be largest number in the list and so is now in the correct
position. We now start aanew pass from left to right.
position. We now start new pass from left to right.

6, 2, 9, 11, 9, 3, 7, 12
Bubble sort
First Pass

6, 2, 9, 11, 9, 3, 7, 12
Second Pass
2, 6,
6, 2, 9, 11,11,11,11, 12
9, 3, 7, 7,
9, 3,

This time we do not have to compare the last two numbers as we know
This time we do not have to compare the last two numbers as we know
the 12 is in position. This pass therefore only requires 6 comparisons.
the 12 is in position. This pass therefore only requires 6 comparisons.
Bubble sort

6, 2, 9, 11, 9, 3, 7, 12
Second Pass
2, 6, 9, 9, 3, 7, 11, 12
Third Pass
2, 6, 9, 9, 3, 7, 11, 12
3, 9, 9,
7,

First Pass

This time the 11 and 12 are in position. This pass therefore only
This time the 11 and 12 are in position. This pass therefore only
requires 5 comparisons.
requires 5 comparisons.
Bubble sort

6,
Second Pass
2,
Third Pass2,
Fourth Pass
2,

First Pass

2,
6,
6,
6,

9,
9,
9,
3,
9,

11, 9, 3, 7,
9, 3, 7, 11,
3, 7, 9, 11,
7,
9, 9,
3, 7, 9, 11,

12
12
12
12

Each pass requires fewer comparisons. This time only 4 are needed.
Each pass requires fewer comparisons. This time only 4 are needed.
Bubble sort

6,
Second Pass
2,
Third Pass2,
Fourth Pass
2,
Fifth Pass
2,

First Pass

2,
6,
6,
6,
3,
6,

9,
9,
9,
3,
6,
3,

11, 9, 3, 7,
9, 3, 7, 11,
3, 7, 9, 11,
7, 9, 9, 11,
7, 9, 9, 11,

12
12
12
12
12

The list is now sorted but the algorithm does not know this until it
The list is now sorted but the algorithm does not know this until it
completes aapass with no exchanges.
completes pass with no exchanges.
Bubble sort

6,
Second Pass
2,
Third Pass2,
Fourth Pass
2,
Fifth Pass
2,
Sixth Pass 2,

First Pass

2,
6,
6,
6,
3,
3,

9,
9,
9,
3,
6,
6,

11, 9, 3, 7,
9, 3, 7, 11,
3, 7, 9, 11,
7, 9, 9, 11,
7, 9, 9, 11,
7, 9, 9, 11,

12
12
12
12
12
12

This pass no exchanges are made so the algorithm knows the list is
This pass no exchanges are made so the algorithm knows the list is
sorted. It can therefore save time by not doing the final pass. With other
sorted. It can therefore save time by not doing the final pass. With other
lists this check could save much more work.
lists this check could save much more work.
Bubble sort
start
i=2,n
j=n,i,-1
false
a(j-1) > a(j)
temp=a(j-1)
a(j-1)=a(j)
a(j)=temp

end
65
Code for bubble sort
public static void bubbleSort(int[] a) {
int outer, inner;
for (outer = a.length - 1; outer > 0; outer--)
{ // counting down
for (inner = 0; inner < outer; inner++)
{
// bubbling up
if (a[inner] > a[inner + 1])
{ // if out of order...
int temp = a[inner];
// ...then swap
a[inner] = a[inner + 1];
a[inner + 1] = temp;
}
}
}
}
Bubble sort
with Hungarian ("Csángó") folk dance

67
Merge sort
• Divide array into two halves.
• Recursively sort each half.
• Merge two halves to make sorted whole.

A

L

G

O

R

I

T

H

M

S

A

L

G

O

R

I

T

H

M

S

divide

A

G

L

O

R

H

I

M

S

T

sort

A

G

H

I

L

M

O

R

S

T

merge
Merge sort
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
smallest

A

G
A

smallest

L

O

R

H

I

M

S

T
auxiliary array
Merge sort
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
smallest

A

G
A

smallest

L
G

O

R

H

I

M

S

T
auxiliary array
Merge sort
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
smallest

A

G
A

L
G

smallest

O
H

R

H

I

M

S

T
auxiliary array
Merge sort
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
smallest

A

G
A

L
G

smallest

O
H

R
I

H

I

M

S

T
auxiliary array
Merge sort
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
smallest

A

G
A

L
G

smallest

O
H

R
I

H
L

I

M

S

T
auxiliary
array
Merge sort
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
smallest

A

G
A

L
G

O
H

smallest

R
I

H
L

M

I

M

S

T
auxiliary array
Merge sort
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
smallest

A

G
A

L
G

O
H

smallest

R
I

H
L

M

I
O

M

S

T
auxiliary array
Merge sort
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
smallest

A

G
A

L
G

O
H

smallest

R
I

H
L

M

I
O

M
R

S

T
auxiliary array
Merge sort
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
first half
exhausted

A

G
A

L
G

O
H

R
I

smallest

H
L

M

I
O

M
R

S
S

T
auxiliary array
Merge sort
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
first half
exhausted

A

G
A

L
G

O
H

R
I

smallest

H
L

M

I
O

M
R

S
S

T
T

auxiliary array
Merge sort
We learnt!
•
•
•
•
•
•
•

What is sorting.
Sorting algorithms.
Types of sorting algorithms.
Bubble Sort.
Insertion Sort.
Selection Sort.
Merge Sort.
Quiz
1.

One of the simplest sorting algorithms is called bubble
sort. Do you know why?
A

It encases each element in a 'bubble' before sorting
them.

B

It's a mystery. Why is anything called what it is,
really?
The designer hoped more people would use his sort if
it had a cute name

C
D

Teacher Guide Quiz Question

Smaller elements 'bubble' to the top

Teacher Guide Quiz Solution
Quiz
2.

In which case would an insertion sort perform best,
assuming it was reading the array to be sorted from
beginning to end (as opposed to randomly)?
A

If the array was sorted in reverse order.

B

If the array was already sorted.

C

If the array was in a random order.

D

These will all perform equally well.
Homework
Sort the following array using each of the four sorting
algorithms.
26
a)
b)
c)
d)

48

12

Bubble Sort
Selection Sort
Insertion Sort
Merge Sort

92

28

6

33

Contenu connexe

Tendances

Searching/Sorting algorithms
Searching/Sorting algorithmsSearching/Sorting algorithms
Searching/Sorting algorithmsHuy Nguyen
 
Chapter 11 - Sorting and Searching
Chapter 11 - Sorting and SearchingChapter 11 - Sorting and Searching
Chapter 11 - Sorting and SearchingEduardo Bergavera
 
Topic11 sortingandsearching
Topic11 sortingandsearchingTopic11 sortingandsearching
Topic11 sortingandsearchingGopi Saiteja
 
Introduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searchingIntroduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searchingMvenkatarao
 
Chapter 14 Searching and Sorting
Chapter 14 Searching and SortingChapter 14 Searching and Sorting
Chapter 14 Searching and SortingMuhammadBakri13
 
(Data Structure) Chapter11 searching & sorting
(Data Structure) Chapter11 searching & sorting(Data Structure) Chapter11 searching & sorting
(Data Structure) Chapter11 searching & sortingFadhil Ismail
 
Sorting (Bubble,Merge,Selection sort)
Sorting (Bubble,Merge,Selection sort)Sorting (Bubble,Merge,Selection sort)
Sorting (Bubble,Merge,Selection sort)oDesk
 
3.1 bubble sort
3.1 bubble sort3.1 bubble sort
3.1 bubble sortKrish_ver2
 
Sorting algorithums > Data Structures & Algorithums
Sorting algorithums  > Data Structures & AlgorithumsSorting algorithums  > Data Structures & Algorithums
Sorting algorithums > Data Structures & AlgorithumsAin-ul-Moiz Khawaja
 
Bubble sort
Bubble sortBubble sort
Bubble sortManek Ar
 
Searching & Sorting Algorithms
Searching & Sorting AlgorithmsSearching & Sorting Algorithms
Searching & Sorting AlgorithmsRahul Jamwal
 
0.7 Radical Expressions
0.7 Radical Expressions0.7 Radical Expressions
0.7 Radical Expressionssmiller5
 
Searching Sorting
Searching SortingSearching Sorting
Searching Sortingguest2cb109
 
Linear Systems - Domain & Range
Linear Systems - Domain & RangeLinear Systems - Domain & Range
Linear Systems - Domain & Rangeswartzje
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSGokul Hari
 
Relations and functions
Relations and functionsRelations and functions
Relations and functionsDreams4school
 

Tendances (20)

Searching/Sorting algorithms
Searching/Sorting algorithmsSearching/Sorting algorithms
Searching/Sorting algorithms
 
Chapter 11 - Sorting and Searching
Chapter 11 - Sorting and SearchingChapter 11 - Sorting and Searching
Chapter 11 - Sorting and Searching
 
Topic11 sortingandsearching
Topic11 sortingandsearchingTopic11 sortingandsearching
Topic11 sortingandsearching
 
Introduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searchingIntroduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searching
 
Chapter 14 Searching and Sorting
Chapter 14 Searching and SortingChapter 14 Searching and Sorting
Chapter 14 Searching and Sorting
 
Sorting ppt
Sorting pptSorting ppt
Sorting ppt
 
Sorting
SortingSorting
Sorting
 
(Data Structure) Chapter11 searching & sorting
(Data Structure) Chapter11 searching & sorting(Data Structure) Chapter11 searching & sorting
(Data Structure) Chapter11 searching & sorting
 
Sorting (Bubble,Merge,Selection sort)
Sorting (Bubble,Merge,Selection sort)Sorting (Bubble,Merge,Selection sort)
Sorting (Bubble,Merge,Selection sort)
 
3.1 bubble sort
3.1 bubble sort3.1 bubble sort
3.1 bubble sort
 
Sorting algorithums > Data Structures & Algorithums
Sorting algorithums  > Data Structures & AlgorithumsSorting algorithums  > Data Structures & Algorithums
Sorting algorithums > Data Structures & Algorithums
 
Bubble sort
Bubble sortBubble sort
Bubble sort
 
Searching & Sorting Algorithms
Searching & Sorting AlgorithmsSearching & Sorting Algorithms
Searching & Sorting Algorithms
 
0.7 Radical Expressions
0.7 Radical Expressions0.7 Radical Expressions
0.7 Radical Expressions
 
Sorting
SortingSorting
Sorting
 
Searching Sorting
Searching SortingSearching Sorting
Searching Sorting
 
Functions
FunctionsFunctions
Functions
 
Linear Systems - Domain & Range
Linear Systems - Domain & RangeLinear Systems - Domain & Range
Linear Systems - Domain & Range
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
 
Relations and functions
Relations and functionsRelations and functions
Relations and functions
 

Similaire à Sorting algorithms v01

Unit 12: Probability
Unit 12: ProbabilityUnit 12: Probability
Unit 12: ProbabilityRenegarmath
 
23T1W3 Mathematics ppt on Number Sequence.ppt
23T1W3 Mathematics ppt on Number Sequence.ppt23T1W3 Mathematics ppt on Number Sequence.ppt
23T1W3 Mathematics ppt on Number Sequence.pptRuthAdelekun1
 
Adding Subtracting Integers
Adding Subtracting IntegersAdding Subtracting Integers
Adding Subtracting Integersalvarezd
 
Scaled v. ordinal v. nominal data(3)
Scaled v. ordinal v. nominal data(3)Scaled v. ordinal v. nominal data(3)
Scaled v. ordinal v. nominal data(3)Ken Plummer
 
Sorting in data structures and algorithms , it has all the necessary points t...
Sorting in data structures and algorithms , it has all the necessary points t...Sorting in data structures and algorithms , it has all the necessary points t...
Sorting in data structures and algorithms , it has all the necessary points t...BhumikaBiyani1
 
Comparing and Ordering Integers
Comparing and Ordering IntegersComparing and Ordering Integers
Comparing and Ordering IntegersBrooke Young
 
Gcse revision cards checked 190415
Gcse revision cards checked 190415Gcse revision cards checked 190415
Gcse revision cards checked 190415claire meadows-smith
 
Grade 6 PPT_Math_Q2_W9.pptx
Grade 6 PPT_Math_Q2_W9.pptxGrade 6 PPT_Math_Q2_W9.pptx
Grade 6 PPT_Math_Q2_W9.pptxZaldySombilon
 
From Square Numbers to Square Roots (Lesson 2)
From Square Numbers to Square Roots (Lesson 2) From Square Numbers to Square Roots (Lesson 2)
From Square Numbers to Square Roots (Lesson 2) jacob_lingley
 
Integers 101- Understanding Integers
Integers 101- Understanding IntegersIntegers 101- Understanding Integers
Integers 101- Understanding IntegersKari Knisely, M.Ed.
 

Similaire à Sorting algorithms v01 (20)

Sorting algos
Sorting algosSorting algos
Sorting algos
 
Sorting
SortingSorting
Sorting
 
Sorting algorithms
Sorting algorithmsSorting algorithms
Sorting algorithms
 
DESIGN AND ANALYSIS OF ALGORITHM (DAA)
DESIGN AND ANALYSIS OF ALGORITHM (DAA)DESIGN AND ANALYSIS OF ALGORITHM (DAA)
DESIGN AND ANALYSIS OF ALGORITHM (DAA)
 
Unit 7 sorting
Unit   7 sortingUnit   7 sorting
Unit 7 sorting
 
Bubblesorting
BubblesortingBubblesorting
Bubblesorting
 
Unit 12: Probability
Unit 12: ProbabilityUnit 12: Probability
Unit 12: Probability
 
Integers
IntegersIntegers
Integers
 
23T1W3 Mathematics ppt on Number Sequence.ppt
23T1W3 Mathematics ppt on Number Sequence.ppt23T1W3 Mathematics ppt on Number Sequence.ppt
23T1W3 Mathematics ppt on Number Sequence.ppt
 
Adding Subtracting Integers
Adding Subtracting IntegersAdding Subtracting Integers
Adding Subtracting Integers
 
Scaled v. ordinal v. nominal data(3)
Scaled v. ordinal v. nominal data(3)Scaled v. ordinal v. nominal data(3)
Scaled v. ordinal v. nominal data(3)
 
Sorting in data structures and algorithms , it has all the necessary points t...
Sorting in data structures and algorithms , it has all the necessary points t...Sorting in data structures and algorithms , it has all the necessary points t...
Sorting in data structures and algorithms , it has all the necessary points t...
 
Comparing and Ordering Integers
Comparing and Ordering IntegersComparing and Ordering Integers
Comparing and Ordering Integers
 
Gcse revision cards checked 190415
Gcse revision cards checked 190415Gcse revision cards checked 190415
Gcse revision cards checked 190415
 
Grade 6 PPT_Math_Q2_W9.pptx
Grade 6 PPT_Math_Q2_W9.pptxGrade 6 PPT_Math_Q2_W9.pptx
Grade 6 PPT_Math_Q2_W9.pptx
 
Algo PPT.pdf
Algo PPT.pdfAlgo PPT.pdf
Algo PPT.pdf
 
From Square Numbers to Square Roots (Lesson 2)
From Square Numbers to Square Roots (Lesson 2) From Square Numbers to Square Roots (Lesson 2)
From Square Numbers to Square Roots (Lesson 2)
 
Integers 101- Understanding Integers
Integers 101- Understanding IntegersIntegers 101- Understanding Integers
Integers 101- Understanding Integers
 
Math Gr4 Ch12
Math Gr4 Ch12Math Gr4 Ch12
Math Gr4 Ch12
 
Math Gr4 Ch12
Math Gr4 Ch12Math Gr4 Ch12
Math Gr4 Ch12
 

Dernier

How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Dernier (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

Sorting algorithms v01

Notes de l'éditeur

  1. {"82":"Note: For solving this quiz it is necessary to use Mouse Mischief (A fun way to keep your students&apos; attention and increase participation in the classroom. http://www.microsoft.com/multipoint/mouse-mischief/en-us/default.aspx) or Interactive Classroom (Use classroom polls to improve student learning, http://www.pil-network.com/Resources/Tools/Details/da5d09fd-9362-43b6-9e96-cf9aadc66e6c).\n","50":"Note:Insertion sort is the strategy used by the card player who picks up the card he or she is dealt one at a time and inserts it into his or her existing hand\n","7":"Note: The teacher reminds students what the algorithm is? \n","57":"Note: The Bubble Sort algorithm looks at pairs of entries in the array, and swaps their order if needed.\nIf we compare pairs of adjacent elements and none are out of order, the list is sorted.\nIf any are out of order, we must have to swap them to get an ordered list.\nBubble sort will make passes though the list swapping any adjacent elements that are out of order.\nAfter the first pass, we know that the largest element must be in the correct place.\nAfter the second pass, we know that the second largest element must be in the correct place.\nBecause of this, we can shorten each successive pass of the comparison loop.\n","8":"Teacher: Sorting was intensely studied in the early days (1950&apos;s and 1960&apos;s). At one time it was estimated that a third to a half of all computation time world wide spent on sorting. Now it is a smaller fraction, but still sorting is a widely used operation on data. We will concentrate on 4 sorting algorithms: merge, insertion, quick, and heap. Each of them, besides being important for sorting, has a side benefit in illustrating design and analysis principles\n","81":"Note: For solving this quiz it is necessary to use Mouse Mischief (A fun way to keep your students&apos; attention and increase participation in the classroom. http://www.microsoft.com/multipoint/mouse-mischief/en-us/default.aspx) or Interactive Classroom (Use classroom polls to improve student learning, http://www.pil-network.com/Resources/Tools/Details/da5d09fd-9362-43b6-9e96-cf9aadc66e6c).\n","4":"Teacher: Sorting was intensely studied in the early days (1950&apos;s and 1960&apos;s). At one time it was estimated that a third to a half of all computation time world wide spent on sorting. Now it is a smaller fraction, but still sorting is a widely used operation on data.\n","10":"Teacher: The selection sorting algorithm works by finding the smallest element in current unsorted array and swapping it with the element that it need to be sorted\n"}