We are familiar with imperative data structures. In fact, there are lots of references to imperative data structures in different programming languages. In contrast, there aren't many references to declarative data structures or functional data structures. This is because FP languages are not as mainstream as imperative programming languages. Additionally, designing and implementing functional data structures is more difficult in comparison to imperative counterparts because of the following reasons:
- Mutability is not recommended in FP
- Functional data structures are expected to be more flexible than their imperative counterparts
Imperative data structures rely heavily on mutability and assignments and making them ...