STUDYSHIELDS ASSIGNMENT HELP

  • Home
  • Blog
  • Courses
    • Child Category 1
    • Child Category 2
    • Child Category 3
    • Child Category 4
  • Services
  • Country
    • Childcare
    • Doctors
  • Home
  • Blog
  • Sample Works
  • Order Now

Friday, February 5, 2016

Design an algorithm which gets as input a list of k integer values

 February 05, 2016     No comments   

Design an algorithm which gets as input a list of k integer values N1, N2, ……, Nk as well as a special value SUM. Your algorithm must locate a pair of values in the list N that sum to the value SUM. (10 points) For example, if your list of values is 3, 8, 13, 2, 17, 18, 10, and the value of SUM is 20, then your algorithm would output either the two values (2, 18) or (3, 17). If your algorithm cannot find any pair of values that sum to the value SUM, then it should print out the message ‘Sorry, there is no such pair of values. Work out your algorithm to verify that it will work correctly for the given list and SUM in example. (10 points) Q2. For a shuffle-left algorithm, the best case occurs when the list has no 0 values and worst case occurs when the list has all 0 values. Prove this by taking a two lists of your choice where one is for best case and one for worst case. Show all the comparisons and copies in each step to prove the given statement of best and worst case. Do not write only the points given by the book. Show the workout to show the reasons. (15) Q3. Below is the algorithm for Bubble Sort. 1. Get values for n and the n list items 2. Set the marker U for the unsorted section at the end of the list 3. While the unsorted section has more than one element do steps 4 through 8 4. Set the current element marker C at the second element of the list 5. While C is has not passed U, do steps 6 and 7 6. If the item at position C is less than the item to its left then exchange these two items 7. Move C to the right one position 8. Move U left one position 9. Stop a) Using the bubble-sort algorithm, for each of the following lists, perform sorting, and show the list after each exchange. (5+5 points) i) 4, 8, 2, 6 ii) D, B, G, F, A, C, E b) Explain and prove why the bubble sort algorithm above does T(n2) comparisons on an n-element list. (20 points) Q4) Design a circuit that has three inputs and one output.
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Click Here to Place order

Popular Posts

  • A “criminal minds” Aileen Wournos individual will be your “patient”
     A “criminal minds” Aileen Wournos individual will be your “patient”  A brief history of the patient including diagnoses (documented or your...
  • CEO Jane Lionel has some hard decisions to make with regard to some of the company’
     CEO Jane Lionel has some hard decisions to make with regard to some of the company’solder hands, and even on the eve of that decision, I be...
  • Problem in Supply Chain
    Problem in Supply Chain Problem 2. (Chapter 11: The Storage and Handling System) Compare the constrast private ownership of storage space to...

Recent Posts

Unordered List

Pages

  • Home

Text Widget

Blog Archive

  • November 2022 (20)
  • October 2022 (50)
  • September 2022 (119)
  • August 2022 (107)
  • February 2022 (501)
  • January 2022 (443)
  • December 2021 (488)
  • November 2021 (1574)
  • October 2021 (28)
  • September 2021 (11)
  • July 2021 (8)
  • June 2021 (15)
  • May 2021 (39)
  • April 2021 (15)
  • March 2021 (303)
  • February 2021 (712)
  • January 2021 (903)
  • December 2020 (2)
  • September 2020 (33)
  • April 2016 (5183)
  • March 2016 (3763)
  • February 2016 (4356)
  • January 2016 (1749)
  • December 2015 (22)
  • November 2015 (147)
  • October 2015 (23)

Sample Text

Copyright © STUDYSHIELDS ASSIGNMENT HELP | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates