CSE 101 Lecture Notes - Lecture 10: Functional Programming, Imperative Programming, Formal Grammar
Document Summary
Algorithm takes inputs and performs some kind of processing to produce output. Algorithms must consist of steps that are precise and unambiguous because they will ultimately be executed by a computer. Algorithms are generally deterministic, meaning that the inputs uniquely determine the output, with no randomness. Finally, an algorithm must use a finite amount of memory (storage) and terminate in a finite amount of time. Imperative programming involves a key concept, statement, which is a command that directs the computer to do something. Functional programming involves a key concept, function, which is similar to functions in mathematics. Many algorithms can be written more concisely in functional languages than in non-functional ones. Functional programming languages generally don"t read or write data or even assign values to variables. In object-oriented programming (oop), the primary focus is on the data , and secondarily on the actions. Java and python are object-oriented languages, but both have some elements of functional programming.