Big Idea 4 Flashcards
What are the three building blocks of algorithms and what are examples?
Sequencing- a function
Selection- if statement
Iteration- for loops
What is the definition of sequencing?
Sequencing is the application of each step of an algorithm in the order in which the statements are given.
What is the definition of selection?
Selection uses a Boolean condition to determine which of two parts of an algorithm is used.
What is the definition of selection?
Iteration is the repetition of part of an algorithm until a condition is met or for a specified number of times.
Algorithms can be combined to make new algorithms. True or false?
True. Many algorithms have individual operations that undergo. When combined, they can achieve a greater goal that integrates each intention. By using algorithms as building blocks for constructing a new algorithm, it ensures the new algorithm being correct.
Is there only one way to solve a problem?
No. Many different algorithms can be made to solve one issue. The more algorithms you can develop for the same problem shows insight to the problem.
What language types can algorithms include (give examples)?
natural languages (just commanding), pseudocode (actions and demands based on logic-like natural languages), and visual (snap) and textual programming languages (python).
What do natural languages and pseudo codes consist of?
They describe algorithms so that humans can understand them.
Can programming languages be used in ay domain? Why or why not?
Some programming languages are designed for specific domains and are better for expressing algorithms in those domains.
The language used to express the algorithm can affect whether an algorithmic solution exists. True or false?
False. The language used only affects the clarity or readability of the algorithm.
Does it really matter what language you use when expressing any algorithm?
Nope. They’re all equivalent.
Why would one consider one language versus another?
For the purpose of clarity or readability-whatever the user prefers, basically.
What is considered a reasonable time for an algorithm to run?
The number of steps the algorithm takes should be less than or equal to a polynomial function(constant, linear, square, cube, etc) of the size of the input.
What should a coder do if a problem cannot be solved in a reasonable time?
In these cases, heuristic approaches may be helpful to find solutions in reasonable time.
What is a heuristic approach?
A heuristic is a technique that may allow us to find an approximate solution when typical methods fail ti fins an exact solution.