Array of object pointers
Property:
array simplicity
variable size object
no object copy during insertion/deletion operations
deep copy required
Discussions:
This hybrid data structure is commonly used in industry for its combined advantages of linked list (no copy, variable size) and array (direct access and simple operation).
Both dynamic or static array methods can apply to the hybrid structure. Review array of objects page if you need it.
class stockDBhybrid {
public:
stockDBhybrid (int max); // create dynamic stock array
// load, print, insert,... etc...
int size;
int max_size;
stock * port; // array of stock pointers
}
There is no need to create stockNode either.
Implement linked list with array
Property:
no dynamic node
using array index as as next pointer
no packing required for insertion/deletion
similar approach for doubly-linked list
Discussions:
How about implement array with linked list? Why?
It does not seem to have any good reason for doing so, except academic elegance.