amend bug in 'insertBinSearch' function which caused subscriptt error, thereby addressing one of the todo items

This commit is contained in:
2024-09-04 11:53:00 +01:00
parent 7a4a99a408
commit 90019de17f
2 changed files with 2 additions and 3 deletions

BIN
src/string-set Executable file

Binary file not shown.

View File

@@ -200,7 +200,7 @@ struct
helpInsertBinSearch (findChr, keyPos, children, low, mid - 1)
end
else
linearSearch (findChr, keyPos, mid, children)
linearSearch (findChr, keyPos, if mid >= 0 then mid else 0, children)
end
fun insertBinSearch (findChr, keyPos, children) =
@@ -237,7 +237,6 @@ struct
(*
* todo:
* - Debug the Subscript error raised when calling helpInsert
* - Complete code for FOUND_WITH_CHILDREN case in insert function.
*)
@@ -426,5 +425,5 @@ struct
end
| fromList ([]) = raise Empty
val trie = fromList ["hello"]
val trie = fromList ["hello", "bye", "try", "why"]
end