Question: Haskell Language For this part, you have to implement running a comparator network on an input sequence. The command-line for this is Run filename sequence
Haskell Language
For this part, you have to implement running a comparator network on an input sequence. The command-line for this is Run filename sequence where filename is the name for a file containing a comparator network (like sort1.txt), and sequence is a list like [5,1,3,0]. You may assume that the list is in the correct format, that all numbers in the list are distinct, and that its length is equal to the biggest wire number in the comparator network that will be used. You should print out the result of applying the network to the sequence. Just print it to the standard-output channel of the program using a function like putStrLn, and print it out in the Haskell format for lists of integers (you can just call show on a list you compute in your code). There is a public test to check that the running sort1.txt on [5,1,3,0] produces [0,1,3,5]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
