Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please use the Go programming language The following code shows how to access the rows of a2D array represented by a slice of slices. package
Please use the Go programming language
The following code shows how to access the rows of a2D array represented by a slice of slices. package main import "fmt" func fct(line []float64) for ,v:= range line f fmt. Printf("of, ", v) \} Junc main() a) Write a function sort (tab []float 64) that sorts a 1D slice of floating point numbers. Use the algorithm of your choice. b) Write a function transpose (tab [] []float 64 ) that transposes a matrix represented by a slice of slices (rows become columns and vice versa). c) Write a function sortRows (tab [] [] float 64) that sorts the rows of a slice of slices. Each row must be sorted in separate thread. The function must return only when all the threads have completed their sort operation. d) Test your functions by writing a main function that proceeds as follows: a. Print the input 2D array to console b. Sort the rows of this array with sortRows c. Transpose the array with transpose d. Sort the rows of this array with sortRows e. Transpose the array with transpose f. Print the output 2D array to console Show your results on the two arrays in the code provided Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started