Thread: where can i find a good tutorial for linked list,binary trees..

  1. #1
    Banned
    Join Date
    Oct 2008
    Posts
    1,535

    where can i find a good tutorial for linked list,binary trees..

    i got this code

    http://img66.imageshack.us/my.php?image=93367399de7.gif

    i know linked lists a little
    but in this code there are some arrows i cant understand
    what is their meaning??

    is there any tutorial for these arrows thing?

  2. #2
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    Assuming by 'arrows' you mean this ->.

    p->x = (*p).x

  3. #3
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    yes you are correct

    where can i read about them?

  4. #4
    Registered User valaris's Avatar
    Join Date
    Jun 2008
    Location
    RING 0
    Posts
    507
    Not much to read about. When you have a pointer to a struct you can access its elements by using a -> instead of a . It is just easier notation instead of having to dereference the pointer, and then access its elements by using the * operator. (keep in mind that this is what you are doing by using the -> though anyways, it is just shorthand notation).

    (*ObjName).Element == ObjName->Element

  5. #5
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    i found that they are a part of the struct subject
    so they have nothing to do with linked list

  6. #6
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    where can i find a good tutorial on linked lists and
    binary trees?

  7. #7
    Registered User valaris's Avatar
    Join Date
    Jun 2008
    Location
    RING 0
    Posts
    507
    google.com

    I found about 100 of them by typing
    linked list tutorial in C
    binary tree tutorial in C

  8. #8
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    why in the start of this code they write this line:
    typedef struct node node;

    when we are doing typedef command like

    typedef struct A B;

    we get that B is the same data type as A
    so why write to identical names?

  9. #9
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    You don't get that B is the same data type as A. You can't get anything to be the same data type as A, since A is not a data type. B is the same data type as "struct A".

  10. #10
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    in this thread

    http://cboard.cprogramming.com/showthread.php?t=108486

    Quote Originally Posted by robwhit View Post
    typedef creates an alias for a type. so you can do

    struct album CD1, CD2, CD3;

    or you can do

    Album CD1, CD2, CD3;

    Both mean the same thing.
    where is my mistake in understanding these words?

    because in this case i was told that Album and album
    are the same data type
    Last edited by transgalactic2; 10-25-2008 at 04:35 PM.

  11. #11
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by transgalactic2 View Post
    in this post

    http://cboard.cprogramming.com/showthread.php?t=108486



    where is my mistake in understanding these words?

    because in this case i was told that Album and album
    are the same data type
    No you weren't. You were told that Album and struct album were the same data type. There is no data type here called album. Notice how the word album, by itself, appears nowhere in this example.

  12. #12
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    aaahhhh
    Album=struct album

    thanks


    so why are they saing that node=struct node ?

    i know that a node must consists of a variable with same type
    after that line they building struct in that way

    but why adding this typedef line above the struct command

    Code:
    typedef struct node node;
    ??
    Last edited by transgalactic2; 10-25-2008 at 04:45 PM.

  13. #13
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    So then the typedef allows you to say "node" when before you had to say "struct node". It's just an alias.

  14. #14
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    ok i understand
    thanks

  15. #15
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    Quote Originally Posted by tabstop View Post
    No you weren't. You were told that Album and struct album were the same data type. There is no data type here called album. Notice how the word album, by itself, appears nowhere in this example.
    Album appears nowhere

    album i declared as a data type

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 05-10-2002, 04:25 PM
  2. Where can i find a tutorial on WinInet?
    By Inquirer in forum C++ Programming
    Replies: 1
    Last Post: 04-24-2002, 04:34 PM
  3. Wehre to find good header files for C?
    By SupremeOmnipotence in forum C Programming
    Replies: 1
    Last Post: 01-16-2002, 02:04 PM
  4. Link to a good Builder Tutorial
    By incognito in forum C++ Programming
    Replies: 1
    Last Post: 11-17-2001, 04:11 PM
  5. Is there a good tutorial for Windows programming??
    By BubbleMan in forum Windows Programming
    Replies: 3
    Last Post: 08-16-2001, 03:49 PM