cstut9 - To shift more than one step, just include a for...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Returns the index(position in the list) of the element just larger than the input value If need just smaller, return i-1; To return the exact value, add If (i < numElem & list[i] == value) return i; else return -1; Starting from location list[start], shifts “end” elements one step to the right
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: To shift more than one step, just include a for loop: for shifting 3 steps: for (j=1, j&lt;=3, j++) Using findIndex and shiftRight to sort the array....
View Full Document

Ask a homework question - tutors are online