Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
test29
program test29; {pointer example of direct chain growth, key inf change and binary trees} type tree=^top; top=record inf:char ; left, right:tree end ; var l:tree; procedure sostavlenie2(var d:tree; element:char) ; begin if d=Nil then begin New(d) ; d^.inf:=element ; d^.left:=Nil ; d^.right:=Nil ; end else if element< d^.inf then sostavlenie2(d^.left,element) else sostavlenie2(d^.right,element) end ; function branch_search(d:tree;element:char):boolean ; begin if d=Nil then branch_search:=false else if d^.inf=element then branch_search:=true else if element<d^.inf then branch_search:=branch_search(d^.left, element) else branch_search:=branch_search(d^.right, element) end; begin sostavlenie2(l, 'a') ; sostavlenie2(l, 'b') ; sostavlenie2(l, 'c') ; writeln(branch_search(l,'a'));{answer - does the element 'a' present in the binary tree} end.
run
|
edit
|
history
|
help
0
Pokemon2
1
RENAN COSTA CARLOS DA CUNHA 600623343
Akanshapanchal2000@gmail.com
Test 1
test04
Zadanie 3 б
testMatrice0.1
НОД через функцию с возможностью вычисления для трёх и более чисел
practica 9 ejercicio 11