-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotes.txt
More file actions
73 lines (53 loc) · 3.89 KB
/
Notes.txt
File metadata and controls
73 lines (53 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Just general thoughts and notes to keep track of
==========Next Steps // To Do==========
- start looking into visualizing the sorting
- timers to slow down the process?
- different colors for different situations (cell in final spot, pointer cell, cells being swapped, etc...)
- add various sorting algorithms (as many as reasonably possible)
- make everything fully responsive, including changing the laptop screen size and
trying it out on a different monitor altogeher
- debug; look for edge cases or minor improvements
- implement the "general better practices" listed below
- implement some of the listed possible improvements down below
==========Possible improvements==========
known bugs:
- Generating a new array while an animation in running will allow the animation to continue running in the new array.
The option to change the sorting algorithm or generate a new array should be disabled while an animation is running.
general better practices or quick improvements:
- Go through to fix all magic numbers and magic strings
- See if sortedArray in handleSort() in App.js needs to even be reset to undefined. Might be unnecessary code and
will look like I don't know what I'm doing.
- Look to move all sorting algorithm methods and helper methods to another file that can just be imported. Maybe static?
- Refactor so that the algorithm state value being stored doesn't have to be reformatted to be displayed. It's extra code,
and you can just make the stored value be exactly what the displayed value should be.
- Use an enum instead of a string for identifying which algorithm is currently selected
- Use a map function for generating the algorithm option buttons in the dropdown menu
in the navbar. There is a lot of redundant code. Only difficulty would be specifying each unique id.
appearance:
- Put the sort button and the algorithm drop down on the far left. It's the most important it should go first.
- Find another color besides "info".
speed:
- Be able to choose different speeds when sorting; maybe another dropdown
- Or set different sorting speedds depending on the size of the array.
scalability:
- For arrays much larger than 75 in size, cells would have to become much skinnier in order to fit the screen.
Eliminating the numbers all together at that point and just displaying the cells with their sizes and no
numbers would allow for this to happen. You could also reduce the size of the text, but at that point it would be
so small that it would either be too diffocult or simply not worth reading.
- There would have to be some sort of cutoff point because the cells will only be able to be so small to fit
the screen. A possible approach would be to set a max based on the width of the given users screen. Because a
user using a 72-inch monitor would fit vastly more cells than an 8-inch monitor would fit. We shouldn't limit
the cell count to a certain number because the amound that could fit would be different on every screen.
handling negative numbers:
- My approach would be to place the axis of the graph in the center of the screen, so that there is an equal
amount of room for positive and negative numbers to extend. This would cause the heights of each cell to be
significantly shorter but it would allow for a decent visualization of negative numbers.
different levels of sortedness:
- Give the user an option to choose different levels of sortedness to see how different algorithms fair
against a variety of sortedness (random, 'mostly sorted', reversed, etc...)
sorting direction choice
-Let the user choose if they want to sort smallest to greatest or greatest to smallest
extra data:
-Display the time and space complexity of a given sorting algorithm
-Display the number of swaps, comparisons, etc.. after each sort
-Give interesting or notable info about each sorting algorithm