Exercises Homework 7. Algorithmisation Practice #2 Ján Dugáček November 7, 2018 Ján Dugáček 7. Algorithmisation Practice #2 Exercises Homework Table of Contents 1 Exercises 2 Homework Ján Dugáček 7. Algorithmisation Practice #2 Exercises Homework Exercises 1 Write a function that computes the lowest common denominator of two integers (Euclid’s algorithm) 2 Write a function that shuffles a vector (swaps a reasonable number of random elements) 3 Write a function that erases elements with a certain value from a vector 4 Use std::sort to sort a vector of vectors, vector with lowest number of elements goes first Ján Dugáček 7. Algorithmisation Practice #2 Exercises Homework Advanced Exercises 1 Write a function that computes the determinant of a matrix 2 Write a function that takes one argument mult and returns a lambda that multiplies its argument by mult 3 Create a function that can print a function of type int somebodyDoSomething(int val) by printing its x and f (x) from 0 to 10 4 Write a function that computes the eigenvalues of a matrix Ján Dugáček 7. Algorithmisation Practice #2 Exercises Homework Exercises #2 1 Write a function that takes three arguments by reference and shuffles them 2 Write a function that computes the area of an ellipse using the Monte Carlo method 3 Create operators -, *, / and ˆ that work on strings interpreted as numbers Ján Dugáček 7. Algorithmisation Practice #2 Exercises Homework Homework Write a program that reads a file containing a table where one column is x and the other column is f (x) and writes a file that adds lines with values of x that were missing in the original one and interpolated values of f (x) You have two weeks to do it Ján Dugáček 7. Algorithmisation Practice #2