Data Structures

Data Structures and Algorithms

Page 1 of 1

2 Replies - 1814 Views - Last Post: 09 October 2007 - 02:43 AM Rate Topic: -----

#1 rageeb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-October 07

Data Structures

Post icon  Posted 08 October 2007 - 12:30 PM

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.

Is This A Good Question/Topic? 0
  • +

Replies To: Data Structures

#2 malqa053  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 01-October 06

Re: Data Structures

Posted 08 October 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,,,

Was This Post Helpful? 0
  • +
  • -

#3 rageeb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-October 07

Re: Data Structures

Posted 09 October 2007 - 02:43 AM

View Postmalqa053, on 8 Oct, 2007 - 08:14 PM, said:

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
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1