Interfaces
The collection interface is the base interface for all classes in this DS library. All data structure implementations implement the collection interface by default. The collection interface ensures that all classes are having similar behavior of traversable, countable, and JSON serializable. The collection interface has four abstract methods, and they are clear, copy, isEmpty, and toArray. All of the data structure implementations of DS class implement the interface, and we will see these methods at work during our exploration of those data structures.
Another important aspect of the data structure library is to use an object as a key. This can be achieved through the hashable interface of the library. There is another important ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access