w0rthy / ArrayVisualizer

Sorting Visualizer with 6 different views and 14 included sorting algorithms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Let ArrayController manage access counts

Zoybean opened this issue · comments

Update the sorting algorithms to let ArrayController manage the array access and comparison counts (aa and comps).
Currently, each sorting algorithm manually updates the comparison and access counts. By delegating access and comparison to the ArrayController (via get and compare), the counts could be managed automatically, and new statistics could be added without needing to update each sorting algorithm to implement it.

Potentially, the management of marked indices could also be delegated to ArrayController, but I am unclear how marking works, and what the meaning of each index/value is in the list (occasionally the array index is used as the list index, and occasionally it is used as the set value, eg in refresharray)