Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
image text in transcribed
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions