In general, arrays, stacks, queues, linked lists, doubly linked lists, and other linear collections will have similar visual representations and animations involved. It may be most efficient to create a base class LinearCollection (perhaps subclassing VGroup) that implements the visuals and animations which are common to all linear collections.
Visuals
[x] Container [Mobject]
[x] Data [Mobject]
[x] Delimiter [Mobject]
Displays a line of Containers separated by Delimiter. Within each Container is an instance of Data.
Container = Square, Delimiter = None, Data=Integer
Functional Components
[x] Insert an element
[x] Remove an element
[ ] Only display first n elements
[ ] Only display last n elements
[x] Sort internal arrays
[x] Implement semantic comparison operators
[x] Override '[]' to return the value of Data at the given index
[x] Override '[] =' to overwrite the value of Data at the given index
[x] Make iteration iterate over values
[x] Override '+' to concatenate two LinearCollections
[x] Override '*' to repeat the array n times
[x] Sort internal arrays
[x] Implement semantic comparison operators
[x] Ensure there are no lingering references in the copy (list-style shallow copy)
Description
In general, arrays, stacks, queues, linked lists, doubly linked lists, and other linear collections will have similar visual representations and animations involved. It may be most efficient to create a base class LinearCollection (perhaps subclassing VGroup) that implements the visuals and animations which are common to all linear collections.
Visuals
Displays a line of Containers separated by Delimiter. Within each Container is an instance of Data. Container = Square, Delimiter = None, Data=Integer
Functional Components