wat list???

Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Reply

Join Date: Mar 2006
Posts: 3
Reputation: ninja is an unknown quantity at this point 
Solved Threads: 0
ninja ninja is offline Offline
Newbie Poster

wat list???

 
0
  #1
Mar 30th, 2006
ok, ppl......
i've got a new problem......
im workin on a package at my coll here and im doin spreadsheet....
i have to implement it using linked list and am having trouble in deciding what sort of a linked list i use.... Wat i tht of was, i can first with an empty list and as the cells are filled, only those which have content in them have to be in the list.... If a cell that had content is made empty, then this has to be removed from the list..... i've been thinkin over this for sometime..... this implementation in a spreadsheet involves no complex manipulation.... i need to retrieve it to display on the screen in cells..... Can any of u guys help me out in deciding the type of list......
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,600
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: 712
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: wat list???

 
0
  #2
Mar 30th, 2006
The only way your post could be less coherent is if you used l33t speak. :rolleyes:
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 3
Reputation: ninja is an unknown quantity at this point 
Solved Threads: 0
ninja ninja is offline Offline
Newbie Poster

Re: wat list???

 
0
  #3
Mar 31st, 2006
OK.... lemme see if i can be more coherent......
Im trying to do a spreadsheet in c language similar to lotus 123 but ofcourse with not as many features..... it involves only basic functions that a spreadsheet can do...... For this i have to have a data structure to store the various cells in the spreadsheet..... The problem i have is that this has to be done using linked lists.... so, surely i cannot be using a singly linked list, probably not even a doubly linked list..... So, i need some help in deciding the type of list i need to select to implement in my program..... well, the thing to be remembered is - that the linked list must be easy to retrieve coz spreadsheets involve only retrieval, insertions and less frequent deletions.... Can any1 help??
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 233
Reputation: Lord Soth is an unknown quantity at this point 
Solved Threads: 4
Lord Soth's Avatar
Lord Soth Lord Soth is offline Offline
Posting Whiz in Training

Re: wat list???

 
0
  #4
Mar 31st, 2006
Hi,

It is a good question indeed, I think you should use a dynamically allocated 2D array of pointers to a Cell struct. (or class if you use c++ and need OO) Let's say initially you allocate space for 100x100 pointers = 40KB. To check if a cell is empty, check if the pointer for that coordinate is null, if you want to use that cell, dynamically allocate space for cell struct (or instantiate a cell object if you use c++) and let the pointer point this. The question is what to do when you need to access beyond 100x100 then just allocate a new 2d array of pointers of adequate size (say 200x100 100x200 or even 1000x1000 < 4MB) and carefully memcpy each row to new array (you may use reallocate too, it would be easier) and release old array. If you don't want to store formatting data (font, color, bgcolor,etc..) on each cell, then create a struct/class style and let the cell type include a pointer to style type which has a single instance for each different style but linked to every cell using it. Nice huh ?

Lore Soth
Reply With Quote Quick reply to this message  
Reply

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



Similar Threads
Other Threads in the Computer Science Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC