Question: CS 404 - HOMEWORK ASSIGNMENT - 1 Solve the following questions: Write an algorithm that finds the smallest element among a, b, and c. 2.
CS 404 - HOMEWORK ASSIGNMENT - 1 Solve the following questions: Write an algorithm that finds the smallest element among a, b, and c. 2. Write an algorithm that finds the second-smallest element among a, b, and c. Assume that the values of a, b, and c are distinct. Write an algorithm that receives as input the nxn matrix A and outputs the transpose. Write an algorithm that receives as input the matrix of a relation R and tests whether R is symmetric. s. Write an algorithm that receives as input the matrix of a relation R and tests whether R is transitive. Write an algorithm that receives as input the matrix of a relation R and tests whether R is a function. 2. Write an algorithm that receives as input the matrix of a relation R and produces as output the matrix of the inverse relation. & Write an algorithm that returns the index of the first item that is less than its predecessor in the sequence. If S is in nondecreasing order, the algorithm returns the value 0. Write an algorithm that returns the index of the first item that is greater than its predecessor in the sequence. Ifs is in nonincreasing order, the algorithm returns the value 0. 10. Write the standard method of adding two positive decimal integers as an algorithm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
