ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

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

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 12 May 2017 My Price 1.00

22C:080/CS:2110 Programming for InformaticsFall

Can someone help me with my recursion homework please? Should be pretty basic for a tutor.  The language is Python, I'll attach a file.  Please reach out if you can help. Thanks in advance. 

 

22C:080/CS:2110 Programming for InformaticsFall 2016Homework 4Date assigned: September 16, 2016Date Due:September 23, 2016 by 11:30am (before class starts).The purpose of this homework is to familiarize you with recursion.Create a file calledrecursion.pywhich shall contain the functions you write for the following two problems. Boththe problems need to be solved using recursion.You just need to submit therecursion.pyfile on ICON.1.Write a functionbisectionas specified below:def bisection(numbers, n):‘‘‘Function bisection takes as input a range of sequential integers starting from 0 and searchesfor the integer n in the range.The bisection search is done recursively. If n is found thenthe function returns ‘Found’, if n is not found then it returns ‘Not Found’.Either way thefunction returns the number of calls made to the bisection function.‘‘‘For example (the expected output is shown inbold):numbers = list(range(10))res1, res2 = bisection(numbers, 1)print(res1, res2)Found 2res1, res2 = bisection(numbers, 11)print(res1, res2)Not Found 52.Write a functionprint_large_stringas specified below:def print_large_string(input_string, max_length):‘‘‘Function takes as input a string and a maximum length. It keeps appending the string to itselfuntilitbecomeseitherequaltoorgreaterthanthe maximum length specified. The functionprints the input string and the current length of the input string on each call. Also once thestring reaches the desired length the system prints out “Length reached” and prints the stringand its length.‘‘‘For example (the expected output is shown inbold):print_large_string(‘abc’, 18)abc 3abcabc 6abcabcabcabc 12Length reached!abcabcabcabcabcabcabcabc 24print_large_string(‘xy’, 15)xy 2xyxy 4xyxyxyxy 8Length reached!xyxyxyxyxyxyxyxy 161/2

Attachments:

Answers

(11)
Status NEW Posted 12 May 2017 06:05 AM My Price 1.00

-----------

Attachments

file 1494571834-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)