Alpha Geek

(8)

$10/per page/Negotiable

About Alpha Geek

Levels Tought:
University

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Environmental science,Essay writing,Programming,Social Science,Statistics Hide all
Teaching Since: Apr 2017
Last Sign in: 346 Weeks Ago, 1 Day Ago
Questions Answered: 9562
Tutorials Posted: 9559

Education

  • bachelor in business administration
    Polytechnic State University Sanluis
    Jan-2006 - Nov-2010

  • CPA
    Polytechnic State University
    Jan-2012 - Nov-2016

Experience

  • Professor
    Harvard Square Academy (HS2)
    Mar-2012 - Present

Category > Computer Science Posted 26 Apr 2017 My Price 5.00

Write a method called interleave that accepts two

Write a method called interleave that accepts two ArrayLists of integers a1 and a2 as parameters and inserts the elements of a2 into a1 at alternating indexes. If the lists are of unequal length, the remaining elements of the longer list are left at the end of a1. For example, if a1 stores [10, 20, 30] and a2 stores [4, 5, 6, 7, 8], the call of interleave(a1, a2); should change a1 to store [10, 4, 20, 5, 30, 6, 7, 8]. If a1 had stored [10, 20, 30, 40, 50] and a2 had stored [6, 7, 8], the call of interleave(a1, a2); would change a1 to store [10, 6, 20, 7, 30, 8, 40, 50].

 

Answers

(8)
Status NEW Posted 26 Apr 2017 04:04 PM My Price 5.00

-----------

Attachments

file 1493224024-Answer.docx preview (406 words )
W-----------rit-----------e a----------- me-----------tho-----------d c-----------all-----------ed -----------int-----------erl-----------eav-----------e t-----------hat----------- ac-----------cep-----------ts -----------two----------- Ar-----------ray-----------Lis-----------ts -----------of -----------int-----------ege-----------rs -----------a1 -----------and----------- a2----------- as----------- pa-----------ram-----------ete-----------rs -----------and----------- in-----------ser-----------ts -----------the----------- el-----------eme-----------nts----------- of----------- a2----------- in-----------to -----------a1 -----------at -----------alt-----------ern-----------ati-----------ng -----------ind-----------exe-----------s. -----------If -----------the----------- li-----------sts----------- ar-----------e o-----------f u-----------neq-----------ual----------- le-----------ngt-----------h, -----------the----------- re-----------mai-----------nin-----------g e-----------lem-----------ent-----------s o-----------f t-----------he -----------lon-----------ger----------- li-----------st -----------are----------- le-----------ft -----------at -----------the----------- en-----------d o-----------f a-----------1. -----------For----------- ex-----------amp-----------le,----------- if----------- a1----------- st-----------ore-----------s [-----------10,----------- 20-----------, 3-----------0] -----------and----------- a2----------- st-----------ore-----------s [-----------4, -----------5, -----------6, -----------7, -----------8],----------- th-----------e c-----------all----------- of----------- in-----------ter-----------lea-----------ve(-----------a1,----------- a2-----------); -----------sho-----------uld----------- ch-----------ang-----------e a-----------1 t-----------o s-----------tor-----------e [-----------10,----------- 4,----------- 20-----------, 5-----------, 3-----------0, -----------6, -----------7, -----------8].----------- If----------- a1-----------
Not Rated(0)