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 interface that allows list functionalities to be implemented in data structure classes and also ensures better performance than the SPL equivalent of doubly linked list and fixed array.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset