Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Insertion sort
(view source)
Revision as of 20:56, April 1, 2008
No change in size
,
20:56, April 1, 2008
m
Category:Computer Science
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
]]
EdBot
Bots
,
Administrators
3,605
edits
Navigation menu
Personal tools
Create account
Log in
Namespaces
Article
talk page
Variants
Views
Read
View source
View history
More
Search
Popular Links
Main Page
Recent changes
New Pages
Random page
Statistics
Edit Console
Special pages
Printable version