Results 1 to 3 of 3
  1. #1
    memo.baghdady is offline Member
    Join Date
    Jul 2012
    Posts
    7
    Rep Power
    0

    Question Help me please ?? What is Difference between The Tree and Tree<E>

    Hi , Everybody I have just read a simple method that performs Preorder Traverse to a tree but a saw a new representation that I had never seen before which is Tree<E> , Can any body explain what is the meaning of the character <E> ? and what are the differences between the Tree and Tree<E> ? and is there any way to convert one instance of them to the other because a have an instance of type Tree I want to traverse it in Preorder way ?
    here is the code and also what is the meaning of Position<E> ??

    public static <E> String toStringPreorder(Tree<E> T. Position<E> v) {
    String s v.elementO.toStringO; / / the main "visit" action
    for (Position<E> w : T.children(v))
    s += n, n + toStringPreorder(T. w);
    return s;
    }

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Help me please ?? What is Difference between The Tree and Tree<E>

    The <E> is part of the Java generics notation and allows for compile-time type checking. Please have a look at the Oracle Java Generics Tutorial for more on this subject.

  3. #3
    memo.baghdady is offline Member
    Join Date
    Jul 2012
    Posts
    7
    Rep Power
    0

    Default Re: Help me please ?? What is Difference between The Tree and Tree<E>

    Thanks Fubarable , I appreciate that reply

Similar Threads

  1. Binary Tree Help - Find the largest sub-tree
    By joshhazel in forum New To Java
    Replies: 2
    Last Post: 01-30-2012, 02:08 AM
  2. Replies: 0
    Last Post: 04-04-2010, 07:40 AM
  3. Help Tree Set
    By ShuiYinDeng in forum New To Java
    Replies: 2
    Last Post: 10-29-2009, 10:45 AM
  4. Creating a Tree and then saving the Tree
    By jackmatt2 in forum New To Java
    Replies: 0
    Last Post: 08-22-2009, 12:51 PM
  5. Need Help With Tree Adt
    By avi in forum New To Java
    Replies: 0
    Last Post: 03-20-2008, 03:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •