程序员升职记第28关三排序代码
简单的冒泡排序算法,达成优化诊断
– HUMAN RESOURCE MACHINE PROGRAM –
a:
INBOX
COPYTO 3
INBOX
COPYTO 4
INBOX
COPYTO 2
SUB 3
JUMPN c
b:
COPYFROM 3
COPYTO 1
COPYFROM 2
COPYTO 3
COPYFROM 1
COPYTO 2
c:
COPYFROM 3
SUB 4
JUMPN d
COPYFROM 3
COPYTO 1
COPYFROM 4
COPYTO 3
COPYFROM 1
COPYTO 4
d:
COPYFROM 3
SUB 2
JUMPN b
COPYFROM 2
OUTBOX
COPYFROM 3
OUTBOX
COPYFROM 4
OUTBOX
JUMP a
DEFINE LABEL 1
eJzjY2Bg4I3dm22V0pR/qtS5YFUjTzlQiOF+rpmlVtaGJKN0vf6StHsbN6T/ObYu4+CpF1nOZ+yqnM8w
jIJRMAqGBQAAtGEXkg;
DEFINE LABEL 2
eJzjZ2BgMK7T6vlTpdVzvEyvf2rhzmky+U1zl2WHrFqd+XjL2wy9vW8z7E+uyAq4erVQ68Whiq3v3zRs
fb+02egdwygYBaNgyAMAPzYfuA;
DEFINE LABEL 3
eJyTYWBgWN50tNC6+lJVb4lap3hh4USZfIY5ibkhqxbkKm2Rz9uwb2rhyQtHy6ffKq2Nube+fvbd5U2i
N++1cly42KW05Uh/aofDRI6SgxO+pzNP2JJ6rK807Vjf3myHidYzqiZfWmE07c+xlNlLHsvPzX11Y37Z
B4ZRMApGwaACAAdlOeg;
DEFINE LABEL 4
eJwTY2BgkG6vs5Nun99yr3X2+vmt9+4vbQ5ZtbTZeoZyi9Gke62Z3dc6nnf29Gj1tPfl9tVMsp7xY/LR
+UbT5m/aOM3+pNG0kxd2Tp59l7v3+VOxTrWnS5tn381uvHSNYRSMglEwJAAA/4Iu9g;
3个数的逻辑关系排序,达成效率诊断
– HUMAN RESOURCE MACHINE PROGRAM –
a:
b:
c:
d:
e:
f:
INBOX
COPYTO 0
INBOX
COPYTO 1
SUB 0
COMMENT 0
JUMPN i
COMMENT 1
INBOX
COP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