944,116 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1792
  • C++ RSS
Sep 27th, 2007
0

Linked List problem

Expand Post »
If I were to write the code for some functions in a 2 dimensional linked list called get_data that finds the data stored in specified row and column and upon successful data retrieval, it returns true or else return false. And the given prototype is: template <class T>
bool get_data(int row, int col, T & data)


... How do I find data stored in a two dimensional linked list?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
leetari is offline Offline
14 posts
since Sep 2007
Sep 27th, 2007
0

Re: Linked List problem

>How do I find data stored in a two dimensional linked list?
Is this a hypothetical question, or do you really have to write such a function? My first inclination would be to count from 0 to row while traversing the outer list, then jumping into the inner list of the node that I stopped on, and do the same thing. I'd return the data I found there, or an error if either of those traversals took me to the end of the list.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: tenis match pseudo
Next Thread in C++ Forum Timeline: Uninitialized Local Variable help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC