Week 4 Flashcards
(6 cards)
What is a Conditional Expression?
Evaluates to one expression or the other, depending on the value of a boolean expression
What is a Case Expression?
Evaluates the expression to a given case
case c of
“u” -> (x,y+1)
“d” -> (x,y-1)
“l” -> (x-1,y)
…
What is the generate-and-select design pattern?
Can be used to describe good solution to the problem, obtained by filtering values from a generator using a selector
What is the Selector?
The Selector can be used to filter out those values that might provide solutions to the problem
What is Polymorphism?
Polymorphism is a key concept in computer science and programming that allows entities to take on multiple forms
It can refer to various programming paradigms, including object-oriented programming (OOP) and functional programming
What is the 2 problems of Code Copying?
Error prone - errors must be fixed in every copy
Inefficient - space must be allocated for every copy