Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine how insertion sort can be observed #53

Open
Tyriar opened this issue Apr 5, 2016 · 2 comments
Open

Determine how insertion sort can be observed #53

Tyriar opened this issue Apr 5, 2016 · 2 comments
Assignees

Comments

@Tyriar
Copy link
Member

Tyriar commented Apr 5, 2016

With the shift observer, several comparisons take place "during" the shift. That is after the item is overwritten but before it's put into it's final position.

@Tyriar Tyriar self-assigned this Apr 5, 2016
@Tyriar
Copy link
Member Author

Tyriar commented Apr 5, 2016

Something like this?

function shiftStartObserver(startIndex) {}
function shiftedValueComparisonObserver(otherIndex) {}
function shiftEndObserver(endIndex) {}

@Tyriar
Copy link
Member Author

Tyriar commented Apr 8, 2016

A problem to be careful of is not to mess with the algorithm too much as it's used as part of the article on GWTW. Perhaps a custom compare function for shifting would be a better idea?

function newTempVariable(array, i)
function compareWithTemp(array, i, temp)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant