Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 11th November 2011
Braincode's Avatar
Braincode Braincode is offline
Ceriwis Addicted
 
Join Date: Nov 2011
Posts: 4,638
Rep Power: 21
Braincode mempunyai hidup yang Normal
Default [HELP] Struktur Data Task in C (Algo)

Ane dpt tugas tp blm ngerti master...

Ane sangat berterima kasih klo ada yg bisa bantu ane...

Task nya kyk gini:




Quote:





Pls modify the algorithm to meet this requirement:

You can know whether the program will halt/terminate immediately when it hits the first false value.



We know that it is no use to explore the rest of the tree when we have found one false value. Though the rest exploration returns true values, the AND operation will yield a false.



Checking whether the number of node at certain level is complete (max number of node possible)-version 2






Quote:





function checkCompNodeAtLevelBT(input p:addr,input level:integer,

input currLevel:integer)>boolean

{return true if the number of node at given level is the most possible;

otherwise return false}

kamus:



algoritma:

if level=0 or p=Nil then

> false

else

if level=1 and p≠Nil then

> true

else

if currLevel true

else

> false

else

> false

else

> countNodeAtLevelBT(p^.left,level,currLevel+1) and

countNodeAtLevelBT(p^.right,level,currLevel+1)






Quote:





Evaluation:



type addr:^elTree

type elTree:

type Tree:

.

.

.

T:Tree

...

level:integer=3 {tree level of interest}

...

if checkCompNodeAtLevelBT(T.root,level,1) then

output(�The tree has complete node at level�,level)

else

output(�The tree has incomplete node at level�,level)

.

.

.





Need help master...

</div>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Terkait
Thread Thread Starter Forum Replies Last Post
[need help] TANTANGAN BUAT YG MASTER STRUKTUR DATA C++ Darkc0der Programming 0 20th November 2011 09:18 AM
MASTER,struktur data tolong saya dong ?? SinggahDapur Programming 0 20th November 2011 02:09 AM
Tentang Struktur Data Darkc0der Programming 0 20th November 2011 01:01 AM
[NEED HELP] Struktur Data Bahasa C Darkc0der Programming 0 20th November 2011 12:53 AM
[?] OOP Java : Struktur Data Linuxmania Programming 0 20th November 2011 12:34 AM

 


All times are GMT +7. The time now is 09:21 PM.