In this section, we had a look at how different programming styles define data structures and their approach to building programs using these data structures. We have seen how imperative programming relies heavily on algorithms and low-level operations. You have learned about basic mutable data structures and basic operations to mutate the data structures, as well as how to compose algorithms in your programming language of choice with the help of these data structures.
In contrast, in the declarative style, the focus shifts from algorithms to mathematical expressions. The collections data structures are usually immutable. You have a lot of high-level operations defined on these data structures. You use these operations in order to express the program, not with algorithms, but as a set of algebraic expressions.
Collections are one of the main aspects of almost any program...