User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 456,507 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,656 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 832 | Replies: 1
Reply
Join Date: Sep 2007
Posts: 2
Reputation: leetari is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
leetari leetari is offline Offline
Newbie Poster

Help Linked List problem

  #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?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2004
Posts: 6,515
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 31
Solved Threads: 489
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: Linked List problem

  #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.
I'm here to prove you wrong.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 3:41 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC