Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 1: write a function that when passed an array of integers returns the index of the smallest integer in the array. Int FindSmallestInt(int array[],

Task 1:

write a function that when passed an array of integers returns the index of the smallest integer in the array.

Int FindSmallestInt(int array[], int size)

function returns the index of the smallest element in the array.

Task 2:

Swap function: this will take as argument the array, its size and two index values. The function will swap values at the two indexes.

Task 3:

Use the two functions from task 1 and 2 for task 3.

You are to hard code an integer array of size 20 with jumbled integer values. To start with the whole array is unsorted.

Find smallest integer in the remaining unsorted array.

Swap it with the the first element of the unsorted array.

Repeat from step 3 from the next index where the smallest was integer was swapped.

When will you stop repeating these steps? When should your function end?

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

More Books

Students also viewed these Databases questions

Question

Explain walter's model of dividend policy.

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago