Linked List problem

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2007
Posts: 2
Reputation: leetari is an unknown quantity at this point 
Solved Threads: 0
leetari leetari is offline Offline
Newbie Poster

Linked List problem

 
0
  #1
Sep 27th, 2007
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?
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,827
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 750
Team Colleague
Narue's Avatar
Narue Narue is online now Online
Senior Bitch

Re: Linked List problem

 
0
  #2
Sep 27th, 2007
>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.
New members chased away this month: 3
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC