Feedback on an idea

J

Jean Charbonneau

Hello,

We are doing a project which focuses on making a graphical kind of
phone-book.

For that, we have as input data a text file. We need to convert that file
from text to binary form, but more than that, we must provide an efficient
data structure so that search through the file is fast.

For that we are going to use a binary-tree and chained-lists. We must use
those anyways, it's a prerequisite for our project.

I guess we shouldn't use the Java implementations of chainedlists, and use
our own implementation instead.

What I am planning to do, is to create the binary file as follow :

Fields of the file :
hashcode << should I use the .hashCode() method, or do my own one ?
datas-used-for-the-phonebook
left-tree-index << used for fast browsing through a binary-tree
right-tree-index << same as before
chained-index << used for the chained-list

What do you think of this ? Is my idea any good in the concept ? I have an
idea on how to make the tree, but it's a bit hard I think without some kind
of background about it, do you got any websites which could help for such
project ?

I post this question in a java newsgroup, since I need opinion from Java
programmers, who know the mecanism of Java and who can tell me if something
would be a hasle or if there is easiest ways of making such thing.

Thank you in advance

Jean
 
T

Tris Orendorff

Hello,

We are doing a project which focuses on making a graphical kind of
phone-book.

For that, we have as input data a text file. We need to convert that
file from text to binary form, but more than that, we must provide an
efficient data structure so that search through the file is fast.

For that we are going to use a binary-tree and chained-lists. We must
use those anyways, it's a prerequisite for our project.

I guess we shouldn't use the Java implementations of chainedlists, and
use our own implementation instead.

Use the Java implementation to get things working. Speed things up later, if necessary.
What I am planning to do, is to create the binary file as follow :

Fields of the file :
hashcode << should I use the .hashCode() method, or do my own one
? datas-used-for-the-phonebook
left-tree-index << used for fast browsing through a binary-tree
right-tree-index << same as before
chained-index << used for the chained-list

What do you think of this ? Is my idea any good in the concept ? I
have an idea on how to make the tree, but it's a bit hard I think
without some kind of background about it, do you got any websites
which could help for such project ?

I post this question in a java newsgroup, since I need opinion from
Java programmers, who know the mecanism of Java and who can tell me if
something would be a hasle or if there is easiest ways of making such
thing.

Before you commit to a file format you should specify what you have:

Phone number, address, first and last name, etc.

Then specify what you will need as operations:

Given a phone number find the address and names for it.
Given an address get the names and numbers of the neighbors, etc.



--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d++ s+:- a+ C+ UL++++ P+ L+ E- W+ N++ o- K++ w+ O+ M !V PS+ PE Y+ PGP t+ !5 X- R- tv--- b++
DI++ D+ G++ e++ h---- r+++ y+++
------END GEEK CODE BLOCK------
 
L

Liz

Sounds like homework ( must use binary-tree ...).
I would use Qsort and keep sorted data in the file
for fast look since insert/delete is likely to be
used infrequently.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top