473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Trees

mia023
89
Hello I just want to ask if trees are implemented in the java API other than the ones defined in the package javax.swing
I also need a good tutorial on them Please.
May 18 '08 #1
6 1214
JosAH
11,448 Expert 8TB
Hello I just want to ask if trees are implemented in the java API other than the ones defined in the package javax.swing
I also need a good tutorial on them Please.
You can have a look at the Swing Tutorial for JTrees and TreeModels. Do you simply
want to display several trees or is the important part on the manipulation of them?
There are also TreeMaps and TreeSets. What exactly do you want to do?

kind regards,

Jos
May 18 '08 #2
mia023
89
You can have a look at the Swing Tutorial for JTrees and TreeModels. Do you simply
want to display several trees or is the important part on the manipulation of them?
There are also TreeMaps and TreeSets. What exactly do you want to do?

kind regards,

Jos
I want to manipulate tree for example to use Binary search Trees
May 18 '08 #3
JosAH
11,448 Expert 8TB
I want to manipulate tree for example to use Binary search Trees
Binary search trees are already implemented by the classes I mentioned in my
previous reply. Or do you insist on writing your own binary tree implementation?

kind regards,

Jos
May 18 '08 #4
mia023
89
Binary search trees are already implemented by the classes I mentioned in my
previous reply. Or do you insist on writing your own binary tree implementation?

kind regards,

Jos
If I want to implement my own Binary sreach Tree what should I do??
May 18 '08 #5
JosAH
11,448 Expert 8TB
If I want to implement my own Binary sreach Tree what should I do??
I'd say: study the topic; design something and implement it. A barebones binary
tree node might look like this (and then some):

Expand|Select|Wrap|Line Numbers
  1. public class Node<T> {
  2.    private T data;
  3.    private Node left;
  4.    private Node right;
  5.    //
  6.    public Node(T data) { this(data, null, null); }
  7.    public Node(T data, Node left, Node right) {
  8.       this.data= data;
  9.       this.left= left;
  10.       this.right= right;
  11.    }
  12.    //
  13.    // your methods here ...
  14. }
  15.  
kind regards,

Jos
May 18 '08 #6
BigDaddyLH
1,216 Expert 1GB
If I want to implement my own Binary sreach Tree what should I do??
Musician, climbing into taxi: take me to Carnegie Hall.
New taxi driver: how you do get to Carnegie Hall?
Musician: practice, young man, practice.
May 18 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: C++ Shark | last post by:
Hi, which stl class is good for creating search trees? I am looking for something flexible, that allows me to search for a required state (of matrices, graphs, etc.) quickly. thanks in...
1
by: barnesc | last post by:
Hi again, Since my linear algebra library appears not to serve any practical need (I found cgkit, and that works better for me), I've gotten bored and went back to one of my other projects:...
3
by: ptrSriram | last post by:
Can someone help me with an algorithm to merge two binary search trees. One method I thought of was to flatten both the trees into sorted lists(inorder traversal),merge those two sorted lists,...
8
by: sudharsan | last post by:
please gimme the logic to merge two binary search trees?I mean which node has to be the root node of the new binary tree?? Thanks in advance
2
by: trusiki | last post by:
I am trying to use C# for my program that deals with manipulation of trees (i.e. finding distance between different nodes, assigning labels to nodes, storing trees, etc.). I know I can probably...
17
Ganon11
by: Ganon11 | last post by:
Hey guys, OK, taking care of this beforehand; I AM a student in a university. This IS part of my homework, and (as a moderator), I'm doing my best to follow the posting guidelines I work so hard...
2
by: parasuram | last post by:
Hi friends ............. this is a question regarding the data structures trees Pleas post it if possible with in 2 days I will thankful if some body could help doing this. Operating...
7
by: Vinodh | last post by:
Started reading about Binary Trees and got the following questions in mind. Please help. Definition of a Binary Tree from "Data Structures using C and C++ by Tanenbaum" goes like this, "A...
8
by: Bert | last post by:
How can my response to this problem be better? The pot doesn't work that well when you enter 25, 21, 17 and some others. The problem: CHRISTMAS TREES The grade 5 class at the local primary...
6
by: rsprawls | last post by:
I found a disk for a b-tree algorithm that I purchased back in 93 or so. I'd hoped to find this, but now I'd like to know how worthwhile are b-trees in today's advancements? This is old C code...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.