![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Best data type to use when sorting data? Topic Summary: Created On: 3-Nov-2006 18:16 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
What is the best data type to use to store this data?
Take for example I have this data set... Mary 12 Tom 13 Keri 11 Pete 10 I will create two arrays: one for the name and one for the age. The reason I am creating arrays is to sort the names in alphabetic order. Array nameArray = create(1,4) Array ageArray = create(1,4) Now, would you recommend using Arrays for sorting or something else? Thanks, ------------------------- pete.kowalski(at)motorola.com |
|
![]() |
|
![]() |
|
Skip lists are automatically sorted when you retrieve them. Try the attached.
|
|
![]() |
|
![]() |
|
Thanks Louie.
I have looked at skip lists before, and they are great. I enjoy how I can have a custom value for a key. With the data set I provided how can I make a skip list to have more than one data item such as 3? For example.... key1 ..... data1 .... data2 ..... data3 Now that I think of it I think three skip lists have to be used. One for data1 and then one for data2 and lastly one for data3. Then I need to make sure the data in the skip lists are kept consistent since a skip list automtically disgards a duplicate key within one skip list. ------------------------- pete.kowalski(at)motorola.com Edited: 3-Nov-2006 at 20:15 by Pete Kowalski |
|
![]() |
|
![]() |
|
A solution is to use a skip for sorting, with the data being the index into an array, where you store all the other data. That way, the data remains consistent to the source without having to worry about duplicates.
Paul ------------------------- Paul dot Tiplady at TRW dot com TRW Automotive |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Best data type to use when sorting data?
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.