dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
1698
share rss forum feed


bigdip

@telus.net

putting a list into a binary search tree

can someone please help me make the following program in prolog. i need it to run as follows...

?- list2tree([7, 5, 1, 3, 6, 9] , T).

T = bt(7, bt(5, bt(1, nil, bt(3, nil, nil)), bt(6, nil, nil)), bt(9, nil, nil));