Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- checkIfBST(t(_, nil, nil)).
- checkIfBST(t(Key, t(LKey, LLT, LRT), nil)):-
- Key > LKey,
- checkIfBST(t(LKey, LLT, LRT)).
- checkIfBST(t(Key, t(RKey, RLT, RRT))):-
- Key > RKey,
- checkIfBST(t(RKey, RLT, RRT)).
- checkIfBST(t(Key, t(LKey, LLT, LRT), t(RKey, RLT, RRT))):-
- Key > LKey,
- Key < RKey,
- checkIfBST(t(LKey, LLT, LRT)),
- checkIfBST(t(RKey, RLT, RRT)).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement