Jump to content
View in the app

A better way to browse. Learn more.

Opusmodus

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

for a musical research project where i work with the sorting processes of different sorting algorithms (bubble-sort, heap-sort ...), i have to program such algorithms myself. the ide is that not only the end result of the algorithm is visible but also the constant changes (the mechansim). here the first: bubble-sort.

very simple and inelegant programmed - but the thing i need to have  :-)

 

bubble-sort:

https://en.wikipedia.org/wiki/Bubble_sort

 

have a look to different sorting algorithms:

 

 

greetings

andré

 


;;; bubble-sort -> with all GEN's to see the process of sorting
;;; end-test "until (equal (sort-asc alist) list)" very uncommon (and strange), 
;;; but most simple-stupid test to check the end, only okay for this kind of idea ("watching the process not the endresult")

(defun bubble-sort (seq)
  (let ((alist))
    (progn
      (setf alist (cond ((pitchp (car seq))
                         (pitch-to-midi seq))
                        ((lengthp (car seq))
                         (omn :length seq))
                        (t seq)))
      
      
      (setf alist (loop until (equal (sort-asc alist) list) 
                    with list = alist
                    append (loop 
                             for i from 0 to (- (length list) 2)
                             for j from 1 to (- (length list) 1)
                             when (> (nth i list) (nth j list))
                             collect (setf list (position-swap (list j i) list))
                             else do (setf list list))))
      
      (cond ((pitchp (car seq))
             (midi-to-pitch alist))
            (t alist)))))
 
  

(bubble-sort (rnd-order '(c5 e4 g3 b7)))
(bubble-sort (rnd-order '(t s e q h w)))
(bubble-sort '(1 6 334 2 6 4 111))

 

Nice. You might like the graphical explanation of search algorithms and other algorithms at https://idea-instructions.com. They are visualising such algorithms basically following an IKAE style of graphics. 

 

Best,

Torsten

Create an account or sign in to comment


Copyright © 2014-2025 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.