Welcome to Dream.In.Code
Become a Java Expert!

Join 149,598 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,907 people online right now. Registration is fast and FREE... Join Now!




Data Structures

 
Reply to this topicStart new topic

Data Structures, Data Structures and Algorithms

rageeb
8 Oct, 2007 - 11:30 AM
Post #1

New D.I.C Head
*

Joined: 8 Oct, 2007
Posts: 4


My Contributions
Hi I am creating a project in Java using "Data Structures". I have created two classes called ClassID and ClassRecord. ClassID holds transaction information of a access control system (for personnel exiting and entering a secure door) while the ClassRecord allow transaction items to be added into a *.txt file(flat file) as well as to search , print items based on staff 's last name or ID number.

I am able to create a text file containing list of information ......the out put looks like this

Jones (surname)
5456 (ID number)
20 (access control number)
0902 (time of transaction)
1 (entering(1)/exiting(0))
Scott
1539
18
0920
0


My question is how can i read those information into a LinkList and sort the access control transactions by the amount of time,name,and ID number the personnal stayed inside secure premise.

Please any help appreciated.
User is offlineProfile CardPM
+Quote Post

malqa053
RE: Data Structures
8 Oct, 2007 - 07:14 PM
Post #2

New D.I.C Head
*

Joined: 1 Oct, 2006
Posts: 11


My Contributions
Well, I'm not sure bout the main problem. However, those kind of stuff could be done by doing the following :

1- make a class that has the ( surename, ID, access number.....) as attributes; if you don't have it yet.

2- on the main class or wherever you read from the file, after reading the info. you store them on a variable of the class type you did in 1.

3- then, add a new Node on a linkedList and store the variable you made in 2 as the Data for this node.

Hopefully that helps,,,

User is offlineProfile CardPM
+Quote Post

rageeb
RE: Data Structures
9 Oct, 2007 - 01:43 AM
Post #3

New D.I.C Head
*

Joined: 8 Oct, 2007
Posts: 4


My Contributions
QUOTE(malqa053 @ 8 Oct, 2007 - 08:14 PM) *

Well, I'm not sure bout the main problem. However, those kind of stuff could be done by doing the following :

1- make a class that has the ( surename, ID, access number.....) as attributes; if you don't have it yet.

2- on the main class or wherever you read from the file, after reading the info. you store them on a variable of the class type you did in 1.

3- then, add a new Node on a linkedList and store the variable you made in 2 as the Data for this node.

Hopefully that helps,,,





Okay, I got the picture..........well let me try that pseudo in code ,thanks a lot
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 11:39PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month