Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use recursion to solve the below: a)) Write a method when you pass it an array of integers, it splits the array into odd an

Use recursion to solve the below:

a)) Write a method when you pass it an array of integers, it splits the array into odd an even sections. It will put the odd numbers at the beginning of the array and the even numbers at the end of the array. The algorithm should work even if the array is all odd or all even. Example: If you input [1,2,3,4,5,6,7,8.9] The output would be: [1,3,5,7,9,2,4,6,8]

b)) Ask the user to read another integer which represents the size of the array to be read in. After you read the integer n, read that many integers and store them in an array, and call the second method and print the resulting array which is split into odd and even section.

pleae make sure u use only one recursion method to solve this problem

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

64 Incident and emergency response plans.

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago