| | |
wat list???
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
![]() |
•
•
Join Date: Mar 2006
Posts: 3
Reputation:
Solved Threads: 0
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......
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......
•
•
Join Date: Mar 2006
Posts: 3
Reputation:
Solved Threads: 0
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??
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??
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
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
![]() |
Similar Threads
- printing a linked list (C++)
- Help me make a list of database servers! (Database Design)
- Win98SE - clearing out startup list (Windows 95 / 98 / Me)
- A List of Acronyms (Geeks' Lounge)
- Posting List (DaniWeb Community Feedback)
Other Threads in the Computer Science Forum
- Previous Thread: finding the length in java
- Next Thread: ER Diagram
| Thread Tools | Search this Thread |
ai algorithm algorithms amazon assignment assignmenthelp assignments automata battery bigbrother binary bittorrent bletchleypark bomb business cern codebreaker compiler computer computerscience computertrackingsoftware connect conversion csc dataanalysis dataintepretation development dfa dissertation dissertations dissertationthesis dissertationtopic ebook employment energy floatingpoint foreclosure foreclosuresoftware fuel gadgets geeks givemetehcodez government graphics hardware history homeowners homeworkassignment homeworkhelp humor ibm idea internet iphone ipod itcontracts jobs kindle laser laws lsmeans mainframes marketing mobileapplication msaccess nano netbeans networking news os p2p piracy piratebay principles rasterizer research sam-being-cute sas science software spying stephenfry study supercomputer sweden technology textfield turing turingtest two'scompliment uk virus ww2






