Open main menu
Home
Random
Log in
Settings
About Conservapedia
Disclaimers
Conservapedia
Search
Changes
← Older edit
Newer edit →
Insertion sort
(view source)
Revision as of 21:09, April 1, 2008
No change in size
,
21:09, April 1, 2008
m
Reverted edits by
EdBot
(
Talk
); changed back to last version by
HelpJazz
Line 9:
Line 9:
'''while''' y > -1 '''and''' Vals(x) > nextval //go through all the values to left and compare, the inequality sign will
'''while''' y > -1 '''and''' Vals(x) > nextval //go through all the values to left and compare, the inequality sign will
//vary based upon the sorting type (nondecreasing or nonincreasing)
//vary based upon the sorting type (nondecreasing or nonincreasing)
−
Vals(y
1) = Vals(x) //compare the value to the left because the conditions haven't been met yet
+
Vals(y
+
1) = Vals(x) //compare the value to the left because the conditions haven't been met yet
y-- //decrease the counter
y-- //decrease the counter
−
Vals(y
1) = nextval //store the value in the right position
+
Vals(y
+
1) = nextval //store the value in the right position
−
[[
Category
:
Computer Science
]]
+
[[
category
:
computer science
]]
Ed Poor
Siteadmin,
Check users
, nsTeam1RO, nsTeam1RW, nsTeam1_talkRO, nsTeam1_talkRW, oversight,
Administrators
30,650
edits