Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add Predicated List Decorator #26

Open
Kalkwst opened this issue Jan 14, 2023 · 0 comments
Open

✨ Add Predicated List Decorator #26

Kalkwst opened this issue Jan 14, 2023 · 0 comments

Comments

@Kalkwst
Copy link
Owner

Kalkwst commented Jan 14, 2023

A predicated list decorator is an additional layer of functionality that can be applied to an existing list data structure to enable it to use a specific rule or condition, known as a predicate, to organize its elements. The decorator allows the user to define a specific predicate for the list, which will be used to organize the elements in the list in a specific way, without modifying the underlying list data structure. This enables the user to add this functionality to an existing list without having to change the way the list is implemented.

From a more technical perspective, a predicated list decorator is a design pattern that can be used to add a new layer of functionality to an existing data structure. It is used to add a predicate-based organization to an existing list without having to change its underlying implementation. The decorator pattern is implemented using inheritance and composition, where the decorator class inherits from the list class and adds new methods and/or fields to the list class. The decorator class wraps the existing list object and adds the new predicate-based functionality by overriding the appropriate methods. The new methods of the decorator class use the predicate to organize the elements in the underlying list object. This way, the decorator class can be easily added to any existing list and can be easily removed if it's not needed anymore. The time complexity of the search, insertion and deletion operations in a predicated list decorator depends on the complexity of the predicate and the size of the list.

@Kalkwst Kalkwst mentioned this issue Jan 14, 2023
26 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant