Skip to content

Commit c08f07d

Browse files
committed
Removed comparison
1 parent 2226a8c commit c08f07d

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

contents/bubble_sort/code/lisp/bubble_sort.lisp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,8 @@
1313
(swap lst n (+ n 1)) ;then
1414
lst)))) ;else
1515

16-
;; Use of an array instead of a list would be faster
16+
;; The built-in sort: (sort (list 5 4 3 2 1) #'<)
1717
(print
1818
(bubble-sort (list 5 4 3 2 1)))
1919
(print
2020
(bubble-sort (list 1 2 3 3 2 1)))
21-
22-
;; The built-in sort is quicker, see the usage below
23-
;; quick test
24-
(assert
25-
(equal (bubble-sort (list 5 4 3 2 1))
26-
(sort '(1 2 3 4 5) #'<)))
27-
28-
(assert
29-
(equal (bubble-sort (list 1 2 3 3 2 1))
30-
(sort '(1 2 3 3 2 1) #'<)))

0 commit comments

Comments
 (0)