[Solved] CS 431 Programming Language Concepts Homework 9

$25

File Name: CS_431_Programming_Language_Concepts_Homework_9.zip
File Size: 442.74 KB

SKU: [Solved] CS 431 Programming Language Concepts Homework 9 Category: Tag:
5/5 - (1 vote)

Homework 91 Scala FunctionsFor this homework, you will use Scala to implement three sorting functions.1. Write a function merge_sort(lst: List[Int]): List[Int] that takesa list, and return a sorted list in increasing order.2. Write a function selection_sort(lst: List[Int]): List[Int] thattakes a list and return a sorted list in increasing order.3. Write a function insertion_sort(lst: List[Int]): List[Int] thattakes a list and return a sorted list in increasing order.You should place your methods inside an object and test them as follows.Object Main{// your sorting methods are placed heredef main(args: Array[String]) {val lst = List(5,4,11,2,3,1,0,9)println(merge_sort(lst))println(selection_sort(lst))println(insertion_sort(lst))}}2 SubmissionPlease write your solution in a text le by the name of hwk9.scala and submitit to the dropbox.1

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS 431 Programming Language Concepts Homework 9[Solved] CS 431 Programming Language Concepts Homework 9
$25