Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 5 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 27 Aug 2017 My Price 9.00

function insertion_sort

Problem 7

 

Write the function insertion_sort(a) that takes an array of numbers and returns an array of the same values in nondecreasing order, without modifying a. Your function should use the insert function written in the previous problem.

>> b = Array.new(12) {Random.rand(100)}

=> [30, 81, 43, 95, 24, 38, 64, 56, 74, 70, 33, 60]

>> insertion_sort(b)

=> [24, 30, 33, 38, 43, 56, 60, 64, 70, 74, 81, 95] >> b

=> [30, 81, 43, 95, 24, 38, 64, 56, 74, 70, 33, 60]

>> insertion_sort(b) == b.sort

=> true

 

 

Problem 8

The factorial of an integer n is defined fact(n)=n!=n?(n-1)?(n-2)???1. Define five different versions of the function fact, named fact1, … fact5. Try to achieve significant variety among your functions.

>> fact1(5)

=> 120

>> fact2(40)

=> 815915283247897734345611269596115894272000000000

Answers

(5)
Status NEW Posted 27 Aug 2017 09:08 AM My Price 9.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)