Guest User

Untitled

a guest
Jun 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. % BST incomplet a carui noduri sunt liste adanci - sa se caute un atom (primul gasit)
  2. % subpunctul a de la subiectul C partea 2
  3.  
  4.  
  5. searchbi(A,_):var(A),!,fail.
  6. searchbi(t(K,L,R),Key):-membera(Key,K),!.
  7. searchbi(t([H|T],L,R),Key):-first_key(H,X),Key<X,!,searchbi(L,Key).
  8. searchbi(t(K,L,R),Key):-last_key2(K,V),V<Key,!,searchbi(R,Key).
  9.  
  10. first_key([First|_],First):-atomic(H),!.
  11. first_key([H|_],R):-first_key(H,R).
  12.  
  13.  
  14. nu merge: zice "no"
  15. habar n-am
Add Comment
Please, Sign In to add comment