1 / 1

onKahendpuu(Graaf g) // Kas graaf g on kahendpuu, mille juureks on graafi tipp indeksiga 0.

Loogiliste meetodite algoritme seoses puu ja kahendpuu struktuurituvastusega. onKahendpuu(Graaf g) // Kas graaf g on kahendpuu, mille juureks on graafi tipp indeksiga 0. Kontrollida, et g oleks puu ( mille juureks on g tipp indeksiga 0 )

gino
Download Presentation

onKahendpuu(Graaf g) // Kas graaf g on kahendpuu, mille juureks on graafi tipp indeksiga 0.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Loogiliste meetodite algoritme seoses puu ja kahendpuu struktuurituvastusega. onKahendpuu(Graaf g) // Kas graaf g on kahendpuu, mille juureks on graafi tipp indeksiga 0. Kontrollida, et g oleks puu (mille juureks on g tipp indeksiga 0) Kontrollida, et graafis g ei oleks tippe, mille aste > 2 onPuu(Graaf g) // Kas graaf g on puu, mille juureks on graafi tipp indeksiga 0. Kontrollida, et g oleks sidus ja puustruktuuriga (onPuustruktuur(g, g.tipp(0))) Soovitavalt: eemaldada graafis g märgistus, mille pani onPuustruktuur. onPuustruktuur(Graaf g, Tipp juur) // Kas graafi antud tipust juur algab puu. Kontrollida, et juur ei oleks juba märgistatud Märgistada juur Juure iga naabri u korral kontrollida, et oleks onPuustruktuur(g, u)

More Related