Preview

This Le Contains The Exercises Hints

Powerful Essays
Open Document
Open Document
7778 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
This Le Contains The Exercises Hints
This file contains the exercises, hints, and solutions for Chapter 3 of the book ”Introduction to the Design and Analysis of Algorithms,” 2nd edition, by
A. Levitin. The problems that might be challenging for at least some students are marked by ; those that might be difficult for a majority of students are marked by .

Exercises 3.1
1. a. Give an example of an algorithm that should not be considered an application of the brute-force approach.
b. Give an example of a problem that cannot be solved by a brute-force algorithm. 2. a. What is the efficiency of the brute-force algorithm for computing an as a function of n? As a function of the number of bits in the binary representation of n?
b. If you are to compute an mod m where a > 1 and n is a large positive integer, how would you circumvent the problem of a very large magnitude of an ?
3. For each of the algorithms in Problems 4, 5, and 6 of Exercises 2.3, tell whether or not the algorithm is based on the brute-force approach.
4. a. Design a brute-force algorithm for computing the value of a polynomial p(x) = an xn + an−1 xn−1 + ... + a1 x + a0 at a given point x0 and determine its worst-case efficiency class.
b. If the algorithm you designed is in Θ(n2 ), design a linear algorithm for this problem.
c. Is it possible to design an algorithm with a better than linear efficiency for this problem?
5. Sort the list E, X, A, M, P, L, E in alphabetical order by selection sort.
6. Is selection sort stable? (The definition of a stable sorting algorithm was given in Section 1.3.)
7. Is it possible to implement selection sort for linked lists with the same
Θ(n2 ) efficiency as the array version?
8. Sort the list E, X, A, M, P, L, E in alphabetical order by bubble sort.
9. a. Prove that if bubble sort makes no exchanges on its pass through a list, the list is sorted and the algorithm can be stopped.
1

b. Write a pseudocode of the method that incorporates this improvement.
c. Prove that the worst-case efficiency of the improved version is

You May Also Find These Documents Helpful

  • Satisfactory Essays

    On the basis of the following data for Seller Co. for 2008 and the preceding year ended December 31, 2007, prepare a statement of cash flows. Use the indirect method of reporting cash flows from operating activities. Assume that equipment costing $125,000 was purchased for cash and equipment costing $85,000 with accumulated depreciation of $65,000 was sold for $15,000; that the stock was issued for cash; and that the only entries in the retained earnings account were net income of $51,000 and cash dividends declared of $13,000.…

    • 618 Words
    • 6 Pages
    Satisfactory Essays
  • Satisfactory Essays

    a. Solve parts a and b of problem 103 on page 605 and problem 104 on page 606 of Elementary and Intermediate Algebra .…

    • 548 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    b. b. Include the function written in Exercise 8a in a working program. Make sure your…

    • 720 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    | According to your reading in FM 5-0, which one of the following is NOT considered a characteristic/behavior of a leader that is a critical thinker? Answer…

    • 734 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    math 239 assignment 1

    • 1831 Words
    • 8 Pages

    Give 5 points for each parts. Note, for both (a) and (b) two possible proofs are possible (see alternate proof…

    • 1831 Words
    • 8 Pages
    Good Essays
  • Powerful Essays

    Exercise 1-9 Final Exam

    • 1831 Words
    • 8 Pages

    can phone in or mail in your exam. If you’re unable to take the exam…

    • 1831 Words
    • 8 Pages
    Powerful Essays
  • Satisfactory Essays

    BSHS 355 Week 3 DQ 2

    • 413 Words
    • 2 Pages

    Complete the Problem 1-3B on page 37, 1-4B on page 37 (Chapter 1) and Problem 2-7B on page 89 (Chapter 2) of your text. Please show your work.…

    • 413 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    6. Press STAT which option will sort data in ascending order? What do you think will happen if option 3 is selected? __________________________________…

    • 641 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Ptlls Assignment 1 Level 4

    • 2424 Words
    • 10 Pages

    Working as an operations trainer for Airline Services Ltd (ASL), my job is to travel around to many of the UK’s major airports to deliver training and development of front line staff. Training within the aviation industry is of critical importance as many of our staff work in a hazardous environment involving live aircraft and heavy machinery. A great deal of the training I deliver is directly related to ASL company operating procedures to ensure that all staff are working to company standards and ensuring their safety and the safety of others. ASL provide a number of services to various major airlines, which range from the very basic (cleaning) to more complex services such as de-icing. The range of complexity in the services that ASL provides, results in a wide range of learner levels, where some staff may find aspects difficult to understand. Within ASL’s workforce there is a great deal of diversity in terms of education level, work experience, age, race, gender and previous knowledge from previous jobs that can make training challenging. It is of huge importance that when delivering training, it is specific to the task that the learner is expected to carry out on a daily basis and at the same time gives them the opportunity to question and discuss aspects of their role openly and not to feel in doubt, criticised or intimidated when voicing their opinion. It is crucial that all staff comply with ASL’s company values of: Quality, Reliability & Performance, (ASL website ref) especially myself during the delivery of training as these values filter throughout the entire company and can make all the difference when securing customer contracts and meeting expectations.…

    • 2424 Words
    • 10 Pages
    Powerful Essays
  • Good Essays

    Assignment BBAC 101 2 1

    • 722 Words
    • 9 Pages

    This assignment must be submitted online (Turn-it-in) and also in person (a hard copy). It is no longer possible to submit assessment via email (absolutely not acceptable).…

    • 722 Words
    • 9 Pages
    Good Essays
  • Satisfactory Essays

    CJA 374 Week 5 DQs

    • 423 Words
    • 3 Pages

    This work of CJA 374 Week 5 Discussion Questions shows the solutions to the following problems:…

    • 423 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Simpsons

    • 982 Words
    • 4 Pages

    1. Rearrange these numbers in order of size, starting with the smallest and ending with the largest, in both digit form and in words. • • • • 5 078 231 5 807 123 587 321 5 780 321 Number (in Digits)…

    • 982 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Medalla4C Ch2 Exer

    • 173 Words
    • 2 Pages

    3 Quick Sort Agents_Metaphor on the Comm_2002 column in ascending order, then in descending order.…

    • 173 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    *Note: All asterisked Questions, Exercises, and Problems relate to material contained in the appendix*to the chapter.…

    • 7223 Words
    • 29 Pages
    Good Essays
  • Satisfactory Essays

    On Course Journal 12

    • 441 Words
    • 2 Pages

    3. Write each action from your list in Step 1 in the appropriate quadrant on your chart.…

    • 441 Words
    • 2 Pages
    Satisfactory Essays

Related Topics