I'm sure this has been addressed before but i didn't see it in a search.
Let's say I have an array and a variable whose value exists somewhere in the array.
I want to locate the variable in the array and determine the value immediately prior to it and immediately after it.
How do I do that efficiently?