Understanding the evaluation pattern
There are some problems where we are given a sequence of data, and we need to evaluate it based on some rules. When dealing with such sequences, the evaluation may require storing contextual information and deferring evaluation until certain triggers are hit. In most cases, to evaluate the sequence, we must move through the sequence, keeping track of several data items and performing some operation on some of these data items on hitting a trigger. The triggers may themselves be of different types, each with its own set of rules for evaluation. Each evaluation may either add, remove, or update data items from the sequence and subsequent triggers operate on the previously evaluated results.
An example of a sequence with data and triggers is given below.
A sequence with data and triggers,
Liking the course? Check our discounted plans to continue learning.