bst in lev

INORDER (1,3,4,5,7,10,11,15)
pseudokod:
inorder(drzewo);
begin
if drzewo <> nil then
begin
inorder(drzewo.lewe_subdrzewo);
print(drzewo.root);
inorder(drzewo.prawe_subdrzewo);
end;
end;
LEVELORDER (7,3,11,1,5,10,15,4)
pseudokod:
levelorderRek(drzewo, poziom)
begin
if drzewo <> nil then
begin
if poziom = 1, then
print(drzewo.root);
else if poziom > 1 then
levelorderRek(drzewo.lewe_subdrzewo, poziom-1);
levelorderRek(drzewo.prawe_subdrzewo, poziom-1);
endif
end
end
levelorder(drzewo)
begin
for d = 1 to height(drzewo)
levelorderRek(drzewo, d);
end

Wyszukiwarka

Podobne podstrony:
E in T?atures & nescessity
Functional Origins of Religious Concepts Ontological and Strategic Selection in Evolved Minds
You maybe in love Blue Cafe
In the?rn
Ghost in the Shell 2 0 (2008) [720p,BluRay,x264,DTS ES] THORA
Steve Fearson Card in Ceiling
E 22 Of Domine in auxilium
Assembly of outer membrane proteins in bacteria nad mitochondria
01 In der Vergangenheit ein geteiltes Land Lehrerkommentar
notatek pl dr in Jaros aw Chmiel, Nauka o materia ?h, Przemiany podczas odpuszczania
in game advertising
In Vitro Anticancer Activity of Ethanolic Extract

więcej podobnych podstron