/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Free solutions & answers for Foundations of Algorithms using C++ Pseudocode Chapter 1 - (Page 3) [step by step] | 91Ó°ÊÓ

91Ó°ÊÓ

Problem 27

Give an algorithm for the following problem and determine its time complexity. Given a list of \(n\) distinct positive integers. partition the list into two sublists, each of size \(n / 2\), such that the difference between the sums of the integers in the two sublists is maximized. You may assume that \(n\) is a multiple of 2

Problem 29

Give a \(\Theta(n \text { lg } n)\) algorithm that computes the reminder when \(x^{n}\) is divided by \(p .\) For simplicity, you may assume that \(n\) is a power of 2 That is, \(n=2^{k}\) for some positive integer \(k\)

Problem 30

Explain in English what functions are in following sets. a. \(n^{O(1)}\) b. \(O\left(n^{O(1)}\right)\) c. \(O\left(O\left(n^{O(1)}\right)\right)\)

Problem 31

Show that the function \(f(n)=\left|n^{2} \sin n\right|\) is in neither \(O(n)\) nor \(\Omega(n)\)

Problem 32

Justify the correctness of the following statements assuming that \(f(n)\) and \(g(n)\) are asymptotically positive functions. a. \(f(n)+g(n) \in O(f(n)), g(n))\) b. \(f^{2}(n) \in \Omega(f(n))\) c. \(f(n)+o(f(n)) \in \Theta(f(n), \text { where of } o(f(n))\) means any function \\[g(n) \in o(f(n))\\]

Problem 33

Give an algorithm for the following problem, Given a list of \(n\) distinct positive integers, partition the list into two sublists, each of size \(n / 2,\) such that the difference between the sums of integers in the two sublists is minimized. Determine the time complexity of your algorithm. You may assume that \(n\) is a multiple of 2

Access millions of textbook solutions in one place

  • Access over 3 million high quality textbook solutions
  • Access our popular flashcard, quiz, mock-exam and notes features
  • Access our smart AI features to upgrade your learning
Access millions of textbook solutions in one place

Recommended explanations on Computer Science Textbooks