Type: Posts; User: felixb
ok, but do you have an idea how can i link between the trees?
but if i have 3 persons for example:
id = 1, addr = z st
id = 2, addr = h st
id = 3, addr = a st
the id's tree will be like: (if i sort it by the id...)
my PERSON type have ID, fname, lname, address
and I built one tree that have that type.
you mean I should build 4 trees (1- ID, 2 - fname, 3 - lname, 4 - address) instead?
how will i do the link...
how to do it?
yes, the "DATA" of the tree is PERSON type (that i create) that have the following information about each person: ID, fname, lname, address.
the tree sorted by the ID
but also i want to search by...
The structure should support small and very large number of records.
The Tree already supports the search (quick and eddicient) records by key field, the ID Number of structure person).
I am writing a program that maintains basic information about people (each person have id num, first name, last name).
I keep all the data using a binary tree, which DATA is PERSON type...
you are right, thnk's for your help.
by post 3 do you mean - SuperMarket_demo.java? if is - so it do execute...
about the constructor, this is the empty constructor
public void SuperMarket()
this.name = null;...
from the console window:
Enter supermarket details:
How many products do you have:
Exception in thread "main" java.lang.NullPointerException
ok, this is the full source's
why not? the function is in class Supermarket that have an empty constructor:
public void SuperMarket()
this.name = null;
this.products = new ArrayList<ProductType>();...
I have 2 classes:
1) productType that have name and price of the productType and an empty consturcor.
2) superMarket that have name of supermarket and arraylist of productTypes (
I have some java projects in eclipse.
I want to organize the projects into some folders in the Package Explorer.
How can I do it? (I tried to add new folder, but it ask me to choose one...
sorry, my mistake. it's print exactly 4.
i run the following code:
why the output is 4.012 and not 4?
ok, i moved it to the catch section.
now it sees to be good.
it run, but incorrect.
if i give 5 incorrect input - it run good, give 5 tries and exiting program after the 5 th attemp.
if i give 4 incorrect and the last is correct - it give 4 tries, i the 5 th...
I try to write piece of code that get input from the user and in case of wrong input give the user anoter chance (total of 3 tries) to type input again.
what is the problem with it?
I have this part of source code
System.out.println("Recored number: " + i+1 + " is:");
I'm trying to write little program that get input from the user (using BufferedReader and readLine() function) the program should run till the user type 'quit'.
so i write something like...