Insertion Sort Visualized
- Day: 29
- Link: https://codepen.io/pontakornth/pen/vYxLyrZ
I am back now. After tiring examination, the exam finished me before I finish the exam. So, I think I might try something I familiar but with a twist.
During the time I prepared for an exam, I found a YouTube video featuring sort algorithm sounded. I am interested to create one too. I use insertion sort because it "looks" sorted when using with the animation. The algorithm itself is not a good idea for sorting large amount of data because the complexity is O(n^2). I heard that it is still suitable for small array.
I used good old canvas API as before. I somehow cannot draw thing inside a loop of sorting. I made the sort function push a copy and position to the queue. There is no sound now.
I am satisfied that I can create this. I wish to add more algorithm, add sound, make it replayable and responsive.