CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 03:35:53 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=84dfb40fbc61138bc99733963a94f810fc08d5d6c666aa27e3b37b85d2dd3802a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22vgF4pyKYioksP0udwJomEwx_x53HiDZn%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cb4f5aea6eb155-BLR
scheme language bottom up mergesort code - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; Merge two sorted lists using the given comparator
- (define (merge comparator list1 list2)
- (define (merge01 l1 l2 acc)
- (cond
- ((null? l2) (append (reverse acc) l1))
- ((null? l1) (append (reverse acc) l2))
- ((comparator (car l2) (car l1))
- (merge01 l1 (cdr l2) (cons (car l2) acc)))
- (else
- (merge01 (cdr l1) l2 (cons (car l1) acc)))))
- (merge01 list1 list2 '()))
- ;; Prepare each element as a singleton list
- (define (sort01 jumble)
- (map list jumble))
- ;; Perform one pass of merging adjacent pairs
- (define (sort02 comparator lists)
- (cond
- ((null? lists) '())
- ((null? (cdr lists)) lists)
- (else
- (cons (merge comparator (car lists) (cadr lists))
- (sort02 comparator (cddr lists))))))
- ;; Repeatedly merge until one list remains
- (define (sort03 comparator lists)
- (cond
- ((null? lists) '())
- ((null? (cdr lists)) (car lists))
- (else
- (sort03 comparator (sort02 comparator lists)))))
- ;; Top‐level sort: prepare, merge‐pass, then finalize
- (define (sort comparator jumble)
- (sort03 comparator (sort02 comparator (sort01 jumble))))
- ;; Entry point: sort the sample list in descending order then display
- (define (main)
- (display (sort > '(4 3 5 6 8 7 1 2 9)))
- (newline))
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐⭐⭐GMAIL Logs (2FA disabled)⭐⭐
Java | 5 sec ago | 0.10 KB
-
⭐✅ MAKE $2500 IN 15 MIN⭐⭐⭐ G
JavaScript | 8 sec ago | 0.24 KB
-
⭐⭐⭐MAKE $9OO INSTANTLY D G⭐⭐
Java | 17 sec ago | 0.10 KB
-
⭐✅ Exploit 2500$ in 15 Minutes⭐⭐⭐ B
JavaScript | 20 sec ago | 0.24 KB
-
Free Crypto Method (NEVER SEEN BEFORE)⭐⭐ W
JavaScript | 22 sec ago | 0.24 KB
-
⭐⭐⭐ChangeNOW Exploit⭐⭐
Java | 29 sec ago | 0.10 KB
-
Free Crypto Method (NEVER SEEN BEFORE)⭐⭐ E
JavaScript | 31 sec ago | 0.24 KB
-
⭐✅ Swapzone Glitch ✅ Working⭐⭐⭐ V
JavaScript | 32 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand