Subject: Data Structures and Algorithms, C++ please help in this take-home quiz. need full marks please double-check ans

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
correctanswer
Posts: 43759
Joined: Sat Aug 07, 2021 7:38 am

Subject: Data Structures and Algorithms, C++ please help in this take-home quiz. need full marks please double-check ans

Post by correctanswer »

Subject: Data Structures and Algorithms, C++ please help
in this take-home quiz. need full marks please double-check answers
to make sure it's correct and complete. will give
upvote.
Subject Data Structures And Algorithms C Please Help In This Take Home Quiz Need Full Marks Please Double Check Ans 1
Subject Data Structures And Algorithms C Please Help In This Take Home Quiz Need Full Marks Please Double Check Ans 1 (50.47 KiB) Viewed 51 times
Question 18 (3 Marks) Suppose we have a square matrix: int matrix[n] [n], where n>0. Can you briefly describe what the code below does (word limit: 100)? You may use an example and draw a figure to illustrate your idea if you want. for (int x = n-1; x > -1; x--) { for (int y = 0; y <n; y++) { if (x < n-1 && y > 0) { matrix [x][y] += std::min (matrix [x+1] [y], matrix [x] [y-1]); } else if (x < n-1) { matrix [x] [y] += matrix [x+1] [y]; } else if (y > 0) { matrix [x][y] += matrix[x] [y-1]; } } std::cout << matrix [0] [n-1] << std::endl;
Register for solutions, replies, and use board search function. Answer Happy Forum is an archive of questions covering all technical subjects across the Internet.
Post Reply