![]() |
binary_search
Should be self explaining...
PHP Code:
|
if (2 in array) true;
else false; ? |
Quote:
It's searches a numeric sorted array in an efficient way (usually only used on big arrays). 200'000 Elements -> only searches 100'000. etc. |
Always nice to have around, although I can't think of...well, any use for it, in Graal.
But if the need comes up, then you've got use covered, my boy. :D |
Admittedly I've never have ever thought of a need for this (my arrays are never ordered) but this is one the first algorithms I was taught =)
Binary Search will save you if you have a gigantic sorted array =D |
All times are GMT +2. The time now is 06:57 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.