From 1ac642aac7664ea36417bbdb2576d6e48df52e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ois=C3=ADn=20Mac=20Fheara=C3=AD?= Date: Sat, 17 Feb 2024 23:50:11 +0000 Subject: [PATCH] 07-more-adverbs.md: flip arguments of binsearch (array to be searched goes on the left) --- 07-more-adverbs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/07-more-adverbs.md b/07-more-adverbs.md index 59a5bce..90ad707 100644 --- a/07-more-adverbs.md +++ b/07-more-adverbs.md @@ -190,7 +190,7 @@ Now that you have seen window, we can look at some more neat adverbs: - *base decode* (`int(x) / int(y)`) is the inverse of base encode. - *split* (`string(x) \ string(y)`) splits `y` on string `x`. - *join* (`string(x) / array(y)`) joins array `y` on string `x`. -- *binary search* (`any(x) ' array(y)`) does a binary search for each element of `x` in `y`. If you do not know what a binary search is, I recommend reading [this article](https://www.khanacademy.org/computing/computer-science/algorithms/binary-search/a/binary-search). +- *binary search* (`array(x) ' any(y)`) does a binary search for each element of `x` in `y`. If you do not know what a binary search is, I recommend reading [this article](https://www.khanacademy.org/computing/computer-science/algorithms/binary-search/a/binary-search). These *can* be implemented using the help of K's primitives (and K's philosophy does support that), but having them as symbols is quite convenient, since they are very commonly used.