












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!













CSE115/ENGR160 Discrete Mathematics 02/28/
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}
procedure change ( c 1 , c 2 , …, cn : values of denominations of coins, where c 1 > c 2 >…> c (^) n ; n: positive integer)
for i:=1 to r
while n≥c (^) i then add a coin with value c (^) i to the change n:=n- c (^) i end