Does anyone have any idea how to run an interpolation search on a linked
list in C++?
int List::interpolationSearch(int id){
Node low = head;
Node mid;
Node high = tail;
}
I don't have any code, I just have absolutely no idea how I would do this
with the exception of assigning a few temporary nodes to the head and the
tail in order to set the the search range into which I would run the
interpolation. Basically this is all I've been able to come up with by
observing the interpolation search used with arrays. With those three
things in mind, I'm searching for an id, but here's where the problem
comes in. How do I know where to tell the method where to start searching.
I've seen the code for an array but I can't figure out how to do it here.
No comments:
Post a Comment