Intro and Basics Flashcards
What is a computational problem?
A general description, from inputs to outputs.
What s a problem instance of a computational problem?
A concrete input.
What is an algorithm?
A well-defined computational procedure that from inputs computes outputs. In other words, it solves a problem instance.
Does algorithm have to work on all inputs/problem instances?
Yes
What is a program?
A particular implementation of some algorithm.
Give a simple description of an Insertion Sort.
Take the next element, insert it into the already sorted part.
What data structure are we using for Insertion Sort
Array
In terms of the resources that the algorithm requires, what are we typically interested in?
- Runtime
- Memory
- Number of basic operations
What is the main parameter when analysing the running time of an algorithm?
Input size
What are the 4 types of analysis?
- Exact analysis
- Best-case
- Worst-case
- Average-case