fixed two issues related to insertion in search-list.sml. First issue: in top level 'insert' function, we called 'insLeft' if new value is greater than first value on right, and we called 'insRight' in the opposite case; this is backwards. Second issue: in base cases of 'insLeft' and 'insRight', when we have reached the end of one side of the list, we used to return the same list we got back instead of adding the new value to this end of the list; this is now fixed.

This commit is contained in:
2024-11-16 19:51:29 +00:00
parent 09d9945201
commit 5e9f118b15
2 changed files with 21 additions and 20 deletions

BIN
shf

Binary file not shown.