Q3: Source code = 1 2 3 4 5 6 7 8 9 10 11 12 13 NMO00 ON object 03 { def doit(x:Int, y:Int): Int = { var s = 0; for (i <

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Q3: Source code = 1 2 3 4 5 6 7 8 9 10 11 12 13 NMO00 ON object 03 { def doit(x:Int, y:Int): Int = { var s = 0; for (i <

Post by answerhappygod »

Q3 Source Code 1 2 3 4 5 6 7 8 9 10 11 12 13 Nmo00 On Object 03 Def Doit X Int Y Int Int Var S 0 For I 1
Q3 Source Code 1 2 3 4 5 6 7 8 9 10 11 12 13 Nmo00 On Object 03 Def Doit X Int Y Int Int Var S 0 For I 1 (300.52 KiB) Viewed 19 times
Q3: Source code = 1 2 3 4 5 6 7 8 9 10 11 12 13 NMO00 ON object 03 { def doit(x:Int, y:Int): Int = { var s = 0; for (i <- i to y) { var a = 1; while( a < x ) { a = a*2; S = 5 + a - y; } } < - S } 14 = 15 16 17 18 19 20 21 non 0 0 0 def main(args: Array[String]): Unit = { println(doit(3, 2)) println(doit(17, 1)) println(doit(2, 5)) } }
Q3.1 (10%) What is the output after running this program? Jūsu atbilde Q3.2 (10%) What is the time complexity of the function doit(x,y)? Jūsu atbilde
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply