Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADT - Lists

Status
Not open for further replies.

GoldenHaddock

Technical User
Joined
Mar 10, 2005
Messages
23
Location
GB
Not sure if this is quite the right forum, but here goes!

Doing a bit of revision for forthcoming exams.....:(

Theres a question on a past paper about lists, which is fine...but the next part of the question is:

"Suggest alternative ADT's for the following:

a) a system designed to store 10,000+ records (just sotred, rarely sorted/reports very rarely run).

b) a system designed to store 10,000+ records whre the main purpose is to sort the records and procude reports.

Any suggestsions? Would a queue be approproiate for part a?

Any advice or links most appreciated!

Thanks :)
 
a) An array
b) A balanced B-Tree
 
You didn't mention growth -- if the quantity of data is fairly static, then an array is good for (a). Otherwise maybe a linked-list. I agree with Polu on using a B-Tree for (b).

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Thanks for that!

I presume B-Tree means binary?
 
Also, another part of the question asks you to support your answer using Big-O. How would I calculate that for an array?
 
It depends on the sort algorithm you use. Most commonly will be O(n^2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top