










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











procedure bubble sort ( a 1 , a 2 , …, a (^) n : real numbers with n≥2)
for i:=1 to n-
for j:=1 to n-i if a (^) j >a (^) j+1 then interchange a (^) j and a (^) j+ { a 1 , a 2 , …, a (^) n is in increasing order }
(n-1)+(n-2)+…+2+1=(n-1)n/2 comparisons are used
procedure insertion sort ( a 1 , a 2 , …, an : real numbers with n≥2) i :=1 (left endpoint of search interval) j := 1 (right end point of search interval) for j:=2 to n begin i:= while a (^) j >a (^) i i:=i+ m:=aj for k:=0 to j-i- aj-k:= a (^) j-k- a (^) i := m end {a 1 , a 2 , …, a (^) n are sorted}
17
E =( x 1 ∨¬ x 2 ∨¬ x 3 )∧( x 1 ∨ x 2 ∨ x 4 )