Merge sort diagram in PlantText UML editor

I’m not aware that this visualization tool has been used for this type of thing but it works pretty well. There are a couple of boxes that were rendered lower than you’d usually want them but this would be very usable for teaching purposes, especially if you used a slightly shorter list.

The nice thing about it being a text editor is you could just copy/paste each step in and render the image again as you’re explaining. And you could assign homework problems with the steps partially filled it, let the student handle the rest, and auto-grade the submitted text file.

About Aeoli Pera

Maybe do this later?
This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Merge sort diagram in PlantText UML editor

  1. Aeoli Pera says:

    Here’s the disorganized code for this one:

    @startuml
    state Unsorted : 4, 2, 7, 3, 5, 13, 11, 8, 6, 2

    state L : 4, 2, 7, 3, 5
    state R : 13, 11, 8, 6, 2

    state LL : 4, 2
    state LR : 7, 3, 5

    state LLL : 4
    state LLR : 2

    state LL_s : 2, 4

    LLL –> LL_s
    LLR –> LL_s

    state LRL : 7
    state LRR : 3, 5

    state LRRL : 3
    state LRRR : 5

    state LRR_s : 3, 5

    LRRL –> LRR_s
    LRRR -> LRR_s

    state LR_s : 3, 5, 7

    LRR_s –> LR_s
    LRL –> LR_s

    state L_s : 2, 3, 4, 5, 7

    LL_s –> L_s
    LR_s –> L_s

    state RRR_s : 2, 6

    RRRL –> RRR_s
    RRRR –> RRR_s

    state RR_s : 2, 6, 8

    RRL –> RR_s
    RRR_s –> RR_s

    state RL_s : 11, 13

    RLL –> RL_s
    RLR –> RL_s

    state R_s : 2, 6, 8, 11, 13

    RL_s –> R_s
    RR_s –> R_s

    state Sorted : 2, 2, 3, 4, 5, 6, 7, 8, 11, 13

    L_s –> Sorted
    R_s –> Sorted

    Unsorted –> L
    Unsorted –> R

    state RL : 13, 11
    state RR : 8, 6, 2

    state RLL : 13
    state RLR : 11

    state RRL : 8
    state RRR : 6, 2

    state RRRL : 6
    state RRRR : 2

    L –> LL
    L –> LR

    LL –> LLL
    LL –> LLR

    LR –> LRL
    LR –> LRR

    LRR –> LRRL
    LRR –> LRRR

    R –> RL
    R –> RR

    RL –> RLL
    RL –> RLR

    RR –> RRL
    RR –> RRR

    RRR –> RRRL
    RRR –> RRRR

    @enduml

  2. aiaslives says:

    If you haven’t tried Mathematica yet, you should.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s