r/computerscience • • Oct 12 '26

General A good example of iteration vs recursion

The Song that Never Ends is iterative. It loops and is aware that it remains the same song.

The Song that Gets on Everybody's Nerves just sings about a song, and sings "this is how it goes:", calling itself.

19 Upvotes

9 comments sorted by

View all comments

1

u/MasterGeekMX Bachelors in CS Oct 12 '26

Maurice Ravel's Bolero or The Bell by Mike Oldfield are good examples of iterative, as they loop again the melody but adding a new instrument.