1/17
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Algoritm is
Description of how to solve a problem.
Algorithms should also be
Unambiguous
Pseudocode is
Meant only to be read by humans.
The purpose of pseudocode is
Present an algorithmic operational principle.
Using decrease and conquer - design strategy
one takes a suitable part of the programs, which will be solved. This will be repeated, until the whole problem is solved.
Insertion sort sorts items
By looking for a placement for each item, one by one, by moving already ordered items.
With large datasets insertion sort is
Becomes very inefficient.
When one start to implement an algorithm, it is important to
Think what would be the most reasonable way to implement it using the programming language at hand.
2. Perform input validation and take care of error handling.
What do we actually measure when measuring an algorithm’s efficiency?
The number of executed operations.
Sharing the data wisely helps (you can pick several)
In the upkeep of the data
To prevent unnecessary waste of storage
To speed up the program
Recursion is especially useful in this course, because
It is easy to solve big problems, which contain similar smaller problems.
“In divide and conquer - design principle, the problem is…
divided into sub-problems, until it is trivial to solve, after which the partial solutions are collected as the final solution.
What types of problems are suited well for “divide and conquer” - design principle?
Recursive and hierarchical
Quicksort starts by
selection one item to be a “pivot”-item.
after selecting one item to be a “pivot”-item, the items are
sorted (partitioned) into two parts: the smaller or the larger than pivot items.
Then items on both sides of the pivot are
Sent as a parameter to a recursive call to quicksort.
(Sent as a parameter to a recursive call to quicksort.) This will be repeated, until
There are so few items left that they are already in the right order.
The idea behind partitioning is
To divide the items into to sub-sets for which the items in the first sub-set fulfil the given condition.