Struktur data – Contoh Program Binary tree [preorder, inorder, postorder]


Langsung aja berikut tampilan output dari programnya:
dengan procedure preorder, inorder, postorder dalam binary tree.
mod5_1

Berikut Scriptya:
#include<stdio.h>

typedef struct node{
char data;
node *left;
node *right;
};
node *root=NULL;

void Tambahnode(node **root, char isi) {
if((*root)==NULL){
node *baru;
baru= new node;
baru->data = isi;
baru->left = NULL;
baru->right = NULL;
(*root)=baru;
}
}

void preorder(node *root) {
if(root !=NULL) {
printf(“%c “, root->data);
preorder(root->left);
preorder(root->right);
}
}

void inorder(node *root) {
if(root !=NULL) {
inorder(root->left);
printf(“%c “, root->data);
inorder(root->right);
}
}

void postorder(node *root) {
if(root !=NULL) {
postorder(root->left);
postorder(root->right);
printf(“%c “, root->data);
}
}

main()
{

char kata;
printf(“Program By: AH. HANDOYO[1412110156]\n\n”);
Tambahnode(&root,kata=’R’);
Tambahnode(&root->left,kata=’A’);
Tambahnode(&root->left->left,kata=’S’);
Tambahnode(&root->left->left->left,kata=’I’);
Tambahnode(&root->left->left->right,kata=’T’);
Tambahnode(&root->right,kata=’E’);
printf(“Tampilan secara PreOrder : “);
preorder(root);
printf(“\nTampilan secara InOrder : “);
inorder(root);
printf(“\nTampilan secara PostOrder : “);
postorder(root);
}

87 Comments Add yours

  1. Tonja mengatakan:

    If you are pregnant and suffering from chronic back pain, you may want to consider chiropractic treatments. There are chiropractors who specialize in the care of pregnant women and even have special tables with openings to accommodate the growing belly! With gentle pressure and manipulation, you may be able to find relief from annoying back pain.

  2. Elaine mengatakan:

    Great write up on Struktur data..
    It is surely amongst the most reliable that Ive looked at in a very long time

  3. Rosalinda mengatakan:

    Great write-up on Bash Shell.
    It is without doubt amongst the best that Ive found in a long time

  4. Roslyn mengatakan:

    Many thanks for the valuable content in your review on Struktur data.
    Regards

  5. Trey mengatakan:

    Heya
    Your article on Struktur data is interesting and also insightful.
    I should be back in order to read through new blog posts..

  6. Bobbye mengatakan:

    Have reference letters ready. A lot of people simply say that they have references available, but a smarter idea is to have reference letters right there with you. That way, the interviewer doesn’t have to play phone tag with your references, and can read immediately how great of a candidate you are.

  7. Leonardo mengatakan:

    Hello There. I found your weblog the usage of msn. That is an extremely smartly written article. I’ll be sure to bookmark it and come back to learn more of your helpful information. Thanks for the post. I’ll definitely return.

  8. Jeannette mengatakan:

    constantly i used to read smaller content that also clear their motive, and that is also happening with this paragraph which I am reading now.

  9. Samuel mengatakan:

    This is really fascinating, You are a very skilled blogger. I’ve joined your feed and stay up for in the hunt for more of your wonderful post. Additionally, I’ve shared your site in my social networks

  10. Margarette mengatakan:

    Heya i’m for the first time here. I came across this board and I find It truly useful & it helped me out much. I hope to give one thing back and aid others such as you helped me.

  11. Lupe mengatakan:

    I was very happy to uncover this website. I wanted to thank you for ones time due to this fantastic read!! I definitely enjoyed every little bit of it and i also have you book-marked to check out new stuff on your site.

  12. Gidget mengatakan:

    I’ve been surfing online greater than three hours lately, but I by no means discovered any fascinating article like yours. It’s pretty worth enough for me. Personally, if all site owners and bloggers made just right content as you did, the internet shall be a lot more useful than ever before.

  13. Antony mengatakan:

    Useful information. Fortunate me I found your website by chance, and I am surprised why this twist of fate did not took place in advance! I bookmarked it.

  14. Jeffry mengatakan:

    I’m extremely impressed along with your writing skills as well as with the layout in your blog. Is that this a paid theme or did you modify it your self? Either way stay up the nice high quality writing, it’s rare to see a nice blog like this one today..

  15. Dedra mengatakan:

    Excellent goods from you, man. I have consider your stuff prior to and you are simply extremely magnificent. I actually like what you have acquired right here, really like what you are stating and the way in which during which you assert it. You make it enjoyable and you continue to care for to stay it smart. I can not wait to read far more from you. This is really a terrific site.

  16. Shela mengatakan:

    I was suggested this web site by way of my cousin. I am no longer positive whether or not this put up is written via him as nobody else realize such detailed about my problem. You’re incredible! Thanks!

  17. Gloria mengatakan:

    It’s great that you are getting thoughts from this post as well as from our discussion made here.

  18. Gustavo mengatakan:

    What’s up friends, good piece of writing and fastidious arguments commented here, I am in fact enjoying by these.

  19. Bud mengatakan:

    I feel that is one of the so much important info for me. And i’m glad reading your article. However wanna observation on few basic issues, The website taste is wonderful, the articles is actually nice : D. Just right activity, cheers

  20. Samual mengatakan:

    Its like you read my mind! You appear to know a lot about this, like you wrote the book in it or something. I think that you could do with some pics to drive the message home a little bit, but instead of that, this is excellent blog. An excellent read. I’ll certainly be back.

  21. Cinda mengatakan:

    Good day! I could have sworn I’ve been to this blog before but after going through many of the posts I realized it’s new to me. Regardless, I’m certainly pleased I discovered it and I’ll be bookmarking it and checking back regularly!

  22. Rita mengatakan:

    I got this website from my buddy who informed me on the topic of this web page and now this time I am browsing this web site and reading very informative posts at this time.

  23. Suzette mengatakan:

    Really when someone doesn’t be aware of then its up to other visitors that they will assist, so here it occurs.

  24. Lupita mengatakan:

    Hi there! I could have sworn I’ve been to this blog before but after going through many of the posts I realized it’s new to me. Nonetheless, I’m definitely happy I discovered it and I’ll be book-marking it and checking back regularly!

  25. Noelia mengatakan:

    I will right away grasp your rss as I can not in finding your e-mail subscription link or newsletter service. Do you’ve any? Kindly let me know so that I may just subscribe. Thanks.

  26. Stuart mengatakan:

    I visit each day some web sites and websites to read posts, however this webpage provides quality based content.

  27. Kam mengatakan:

    Howdy! This article couldn’t be written any better! Going through this article reminds me of my previous roommate! He continually kept talking about this. I am going to forward this article to him. Fairly certain he’s going to have a great read. Many thanks for sharing!

  28. Myra mengatakan:

    Heya i’m for the primary time here. I came across this board and I in finding It really helpful & it helped me out a lot. I hope to present one thing back and aid others like you aided me.

  29. Antony mengatakan:

    I have been surfing online more than three hours lately, but I never found any interesting article like yours. It’s beautiful price enough for me. In my view, if all web owners and bloggers made excellent content as you did, the net will likely be much more helpful than ever before.

  30. Shalanda mengatakan:

    I leave a comment whenever I like a article on a blog or if I have something to add to the conversation. It is triggered by the passion communicated in the post I looked at. And on this post Membuat menu Login sederhana dengan JFrame Form di netbeans | XI DOC (Informatika 2011~D). I was actually excited enough to write a commenta response🙂 I do have a couple of questions for you if you don’t mind. Could it be just me or do some of these comments appear like they are coming from brain dead people?😛 And, if you are writing on other sites, I would like to follow anything fresh you have to post. Could you list all of your public sites like your Facebook page, twitter feed, or linkedin profile?

  31. Craig mengatakan:

    Normally I do not learn post on blogs, however I wish to say that this write-up very pressured me to take a look at and do it! Your writing taste has been amazed me. Thanks, quite great article.

  32. Teodoro mengatakan:

    I think the admin of this web site is truly working hard in support of his website, since here every stuff is quality based data.

  33. Lynne mengatakan:

    Very great post. I simply stumbled upon your weblog and wanted to say that I have really enjoyed surfing around your weblog posts. In any case I will be subscribing in your rss feed and I’m hoping you write once more very soon!

  34. Patricia mengatakan:

    Thanks for any other informative site. Where else could I am getting that kind of info written in such an ideal manner? I have a mission that I am simply now operating on, and I have been on the glance out for such info.

  35. Verena mengatakan:

    Nice post. I learn something totally new and challenging on sites I stumbleupon every day. It will always be helpful to read through content from other authors and use a little something from other sites.

  36. Shelia mengatakan:

    Hi, I do believe this is a great web site. I stumbledupon it😉 I am going to come back once again since i have book marked it. Money and freedom is the best way to change, may you be rich and continue to help other people.

  37. Gracie mengatakan:

    I drop a comment each time I especially enjoy a article on a blog or if I have something to contribute to the discussion. Usually it’s triggered by the fire displayed in the article I read. And on this post Script Untuk Menu Login dengan Database Ms.Access | XI DOC (Informatika 2011~D). I was actually excited enough to drop a thought🙂 I do have 2 questions for you if it’s allright. Is it just me or does it appear like a few of the responses look like they are left by brain dead people?😛 And, if you are posting at other online sites, I’d like to follow everything fresh you have to post. Could you list the complete urls of your shared pages like your Facebook page, twitter feed, or linkedin profile?

  38. Mario mengatakan:

    It’s really a cool and useful piece of info. I am happy that you shared this useful info with us. Please keep us informed like this. Thanks for sharing.

  39. Cornelius mengatakan:

    Truly when someone doesn’t understand then its up to other visitors that they will help, so here it takes place.

  40. Lawerence mengatakan:

    This article will help the internet people for building up new web site or even a weblog from start to end.

  41. Pete mengatakan:

    I’m gone to say to my little brother, that he should also pay a quick visit this website on regular basis to get updated from most up-to-date gossip.

  42. Shelley mengatakan:

    When some one searches for his vital thing, so he/she desires to be available that in detail, thus that thing is maintained over here.

  43. Elliot mengatakan:

    Today, while I was at work, my cousin stole my iphone and tested to see if it can survive a thirty foot drop, just so she can be a youtube sensation. My iPad is now destroyed and she has 83 views. I know this is totally off topic but I had to share it with someone!

  44. Samual mengatakan:

    Because the admin of this web page is working, no uncertainty very rapidly it will be well-known, due to its quality contents.

  45. Kirk mengatakan:

    Generally I don’t read post on blogs, but I would like to say that this write-up very pressured me to take a look at and do so! Your writing taste has been surprised me. Thank you, quite nice post.

  46. Cindy mengatakan:

    I blog quite often and I truly appreciate your content. This great article has truly peaked my interest. I’m going to bookmark your blog and keep checking for new details about once per week. I subscribed to your Feed as well.

  47. Willie mengatakan:

    Hello there! This blog post could not be written any better! Reading through this post reminds me of my previous roommate! He always kept talking about this. I will forward this post to him. Pretty sure he will have a very good read. I appreciate you for sharing!

  48. Marguerite mengatakan:

    WOW just what I was searching for. Came here by searching for fireplace mantels

  49. Bettie mengatakan:

    My partner and I absolutely love your blog and find nearly all of your post’s to be precisely what I’m looking for. Would you offer guest writers to write content in your case? I wouldn’t mind publishing a post or elaborating on a lot of the subjects you write about here. Again, awesome website!

  50. Herbert mengatakan:

    Oh my goodness! Awesome article dude! Thank you, However I am experiencing issues with your RSS. I don’t understand the reason why I am unable to join it. Is there anybody else having identical RSS problems? Anybody who knows the answer will you kindly respond? Thanks!!

  51. Cooper mengatakan:

    Your style is really unique in comparison to other folks I have read stuff from. I appreciate you for posting when you’ve got the opportunity, Guess I will just bookmark this blog.

  52. Ethel mengatakan:

    We stumbled over here coming from a different web address and thought I should check things out. I like what I see so now i’m following you. Look forward to looking at your web page yet again.

  53. Corey mengatakan:

    I have been browsing on-line greater than 3 hours today, but I by no means found any fascinating article like yours. It is pretty worth enough for me. Personally, if all web owners and bloggers made excellent content as you did, the internet can be much more useful than ever before.

  54. Frieda mengatakan:

    Good day! I could have sworn I’ve visited this website before but after browsing through many of the articles I realized it’s new to me. Anyways, I’m definitely pleased I came across it and I’ll be book-marking it and checking back often!

  55. Cecilia mengatakan:

    It’s perfect time to make a few plans for the future and it’s time to be happy. I have learn this publish and if I may I want to recommend you few interesting issues or advice. Perhaps you could write subsequent articles relating to this article. I want to read more things approximately it!

  56. Tracie mengatakan:

    I am regular reader, how are you everybody? This post posted at this site is actually fastidious.

  57. Johnny mengatakan:

    It’s really a nice and helpful piece of information. I’m satisfied that you just shared this useful info with us. Please stay us informed like this. Thanks for sharing.

  58. Wendi mengatakan:

    Hello this is somewhat of off topic but I was wanting to know if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding experience so I wanted to get advice from someone with experience. Any help would be enormously appreciated!

  59. Sadie mengatakan:

    you are actually a good webmaster. The web site loading pace is incredible. It seems that you are doing any unique trick. In addition, The contents are masterwork. you’ve done a great activity on this topic!

  60. Madeleine mengatakan:

    These are really wonderful ideas in about blogging. You have touched some nice points here. Any way keep up wrinting.

  61. Marko mengatakan:

    Do you mind if I quote a couple of your articles as long as I provide credit and sources back to your weblog? My website is in the very same area of interest as yours and my visitors would really benefit from a lot of the information you provide here. Please let me know if this ok with you. Thanks!

  62. Lelia mengatakan:

    After looking over a number of the blog posts on your website, I seriously like your way of blogging. I added it to my bookmark website list and will be checking back soon. Please visit my website as well and tell me your opinion.

  63. Ashlee mengatakan:

    I have read so many content about the blogger lovers but this post is actually a fastidious paragraph, keep it up.

  64. Rob mengatakan:

    I’m really impressed together with your writing talents and also with the layout on your blog. Is that this a paid subject matter or did you customize it your self? Anyway stay up the excellent quality writing, it is rare to see a great weblog like this one nowadays..

  65. Jaime mengatakan:

    Hi everybody, here every person is sharing such know-how, thus it’s nice to read this blog, and I used to pay a quick visit this website every day.

  66. Ara mengatakan:

    A fascinating discussion is worth comment. I believe that you ought to publish more about this issue, it may not be a taboo subject but typically people don’t talk about such issues. To the next! Kind regards!!

  67. Tanya mengatakan:

    My family members all the time say that I am wasting my time here at web, except I know I am getting experience everyday by reading thes pleasant articles.

  68. Arnoldo mengatakan:

    Its such as you learn my mind! You appear to grasp so much approximately this, such as you wrote the book in it or something. I feel that you just could do with some percent to drive the message house a little bit, but other than that, this is wonderful blog. An excellent read. I will definitely be back.

  69. Marilyn mengatakan:

    It’s very easy to find out any topic on web as compared to books, as I found this article at this website.

  70. Arletha mengatakan:

    Awesome things here. I’m very satisfied to see your article. Thanks so much and I’m taking a look forward to touch you. Will you kindly drop me a e-mail?

  71. Nell mengatakan:

    Hi every one, here every one is sharing these kinds of know-how, so it’s good to read this web site, and I used to visit this weblog everyday.

  72. Chiquita mengatakan:

    Fantastic beat ! I would like to apprentice while you amend your web site, how could i subscribe for a blog site? The account aided me a acceptable deal. I had been tiny bit acquainted of this your broadcast offered bright clear concept

  73. Lyndon mengatakan:

    Superb, what a webpage it is! This web site provides helpful facts to us, keep it up.

  74. Madge mengatakan:

    When I initially commented I appear to have clicked on the -Notify me when new comments are added- checkbox and now each time a comment is added I recieve four emails with the same comment. Perhaps there is an easy method you can remove me from that service? Appreciate it!

  75. Edwardo mengatakan:

    My brother recommended I may like this website. He used to be entirely right. This submit truly made my day. You cann’t imagine simply how much time I had spent for this information! Thank you!

  76. Maribel mengatakan:

    I simply couldn’t go away your web site before suggesting that I really loved the standard info an individual provide for your guests? Is going to be back ceaselessly to check up on new posts

  77. Fidel mengatakan:

    Hurrah! At last I got a webpage from where I be capable of in fact get useful facts concerning my study and knowledge.

  78. Caitlyn mengatakan:

    Hello my friend! I want to say that this post is awesome, great written and include approximately all vital infos. I’d like to look extra posts like this .

  79. Neal mengatakan:

    This paragraph is actually a pleasant one it assists new net users, who are wishing for blogging.

  80. Arturo mengatakan:

    It’s remarkable designed for me to have a web site, which is useful in favor of my know-how. thanks admin

  81. Ruben mengatakan:

    Hello there, You’ve done a fantastic job. I will definitely digg it and personally recommend to my friends. I am sure they’ll be benefited from this site.

  82. Kayla mengatakan:

    Hi, I do believe this is an excellent blog. I stumbledupon it😉 I will come back once again since I bookmarked it. Money and freedom is the best way to change, may you be rich and continue to help other people.

  83. Eleanore mengatakan:

    Definitely believe that which you stated. Your favorite justification appeared to be on the net the easiest thing to be aware of. I say to you, I definitely get annoyed while people think about worries that they plainly do not know about. You managed to hit the nail upon the top as well as defined out the whole thing without having side effect , people can take a signal. Will probably be back to get more. Thanks

  84. Floy mengatakan:

    We absolutely love your blog and find almost all of your post’s to be just what I’m looking for. Would you offer guest writers to write content in your case? I wouldn’t mind publishing a post or elaborating on many of the subjects you write about here. Again, awesome blog!

  85. Somebody essentially help to make seriously posts I might
    state. That is the first time I frequented your web page and to this point?
    I amazed with the analysis you made to create this particular submit extraordinary.
    Great job!

  86. Usually I do not read post on blogs, but I would like to say that this write-up very forced me to try and do it!
    Your writing style has been amazed me. Thank you, quite great article.

  87. descent 2 mengatakan:

    Excellent article. I will be facing many of these issues as well..

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s