Quick question for a CS Major

CaptainKahuna

Platinum Member
May 19, 2002
2,228
0
0
www.billda.com
My teacher asked us to think about between classes:

In what circumstances would you implement the List abstract data type using a.) linked lists or b.) cursors?

I can't seem to figure out what would be the difference. Would it be that linked lists take less memory?

Yes, this is homework, but it's not for a grade, I'd really like to at least understand this before class.
 

mercanucaribe

Banned
Oct 20, 2004
9,763
1
0
One makes photospectralized algorithms perform more efficiently, especially in the case of an unpointered matrix of null references.
 

CaptainKahuna

Platinum Member
May 19, 2002
2,228
0
0
www.billda.com
Originally posted by: mercanucaribe
One makes photospectralized algorithms perform more efficiently, especially in the case of an unpointered matrix of null references.

Thanks for getting the obligatory rediculous answer out of the way.

Now maybe someone can give some real advice.
 

DaShen

Lifer
Dec 1, 2000
10,710
1
0
wouldn't cursors be preferable if you don't want to iterate through a list object to find something?

I mean cursors would be good for large data storage right, since it is just a flat file with a delimiter, while a list is an object which would take up a lot of virtual memory if it grew to the size of a flat file database.

**EDIT**
This is just a guess BTW. Both algorithmically iterate through a list, but a cursor is stored in a file, while the list is an object created by the application.
 

CaptainKahuna

Platinum Member
May 19, 2002
2,228
0
0
www.billda.com
DaShen,

Thanks for the well thought out response, I appreciate it. I guess that does make sense, that a linked list would have to be created in memory in it's entirety at run time, whereas the cursor based list could be stored in a file and read from disk as needed (in portions).

Thanks!
 

DaShen

Lifer
Dec 1, 2000
10,710
1
0
Originally posted by: Cooler
I use link lists all the time they are my other array.

They definitely are good for applications and efficiency, but when storing large datasets, cursors are probably better.