What are positive and negative indices?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Positive indices are applied when the search begins from left to right. In negative indices, the search begins from right to left. For example, in the array list of size n the positive index, the first index is 0, then comes 1, and until the last index is n-1. However, in the negative index, the first index is -n, then -(n-1) until the last index -1.