in the generic linked list, where we con store any kind of data but same type of data in the entire linked list and only fixed no of data in the entire linked list. I want such a linked list that can store data belonging to different data types in every node and any no of items of respective data types as well? is there any programming technique
Asked
Active
Viewed 23 times
0
-
1Yes, by storing a class or struct in the linked list. This isn't enough information. – WalterM Nov 17 '15 at 19:59
-
but when you store the struct and class also you are restricting the same set of data types to be stord in the entire node;s of the linked list even this can lead to a lot of memory wastage when a few items are to be stored in one node and in another node we want to store a larger no of items than the prvious node – Guru Charan Nov 17 '15 at 20:05
-
This is not enough information for me to go by. A Linked List by definition wastes alot of RAM anyways. It tends to allocate little chunks of fragmented memory all over the place. In general, Unless your application is using tons of ram to begin with I don't see it using too much RAM as a problem. Pre-Optomization is the root of all evil. – WalterM Nov 17 '15 at 21:07