So here’s my issue, i hope this makes sense I’m terrible at explaining things
I don’t have any code to show for this all I’ve done is a few rough notes in my history copy that I relay all the important info from in this.
I’m creating a list of random ints, and making my own quicksort algorithm for it. My question is can i have a list of numbers, and each number has it’s own data attached to it. My point on this is to work out weather or not a number has been used as a pivot, because once it’s ben used as a pivot its in the right place in the list, and if there’s a number alone in between 2 pivots then it’s also in the right place
So if i have a list that looks like
42 17 79 55 33 91 68 10 26 83
It’ll be sorted like this (key is; [current pivot] (previous pivot) {between 2 pivots})
42 17 79 [55] 33 91 68 10 26 83
42 18 [33] 10 26 (55) 79 91 68 [83]
[17] 10 26 (33) {42} (55) [79] 68 (83) {91}
{10} (17) {26} (33) {42} (55) {68} (79) (83) {91}
so how would i represent the data how i did there with the different brackets (doesn’t necessarily have to be with brackets that’s just an example)? I’ve considered having a second list but you have to move arround that list too and it just gets very confusing