So I have this assignment where I have to compare a bunch of sorting methods and count the number of comparisons and the number of copies each algorithm performs.I have already created my sorting methods but have never made a counter before. My question is how would I declare a counter and where would I put one in my code?
Sorry completely forgot, kinda overwhelmed right now. I'm using java.
I know I would put like counter++ before the swap or comparison I'm just a little lost on the syntax