Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Coding puzzle (4)
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00665368
Message ID:
00665456
Views:
31
right, you are treating the ordered array like it is an ordered binary tree, which is okay for finding the max element. But without pointers and/or using some recursion, you'll have a very messy solution.

The problem is you want to find the first the element that is closest to X, but not greater then it. I think, it would do to simply linearly search, starting from the greatest element and then continue backwards until you find the element that meets this condition.

that's what i did. then you end that loop, and start another one.

matt
Previous
Reply
Map
View

Click here to load this message in the networking platform