Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA Draw a Flowchart for linear search algorithm using this code: If your array A has the following elements: 1, 2, 8, 6, 4, trace

JAVA

Draw a Flowchart for linear search algorithm using this code:

image text in transcribed

If your array A has the following elements: 1, 2, 8, 6, 4, trace your algorithm in these three cases:

- Find the value 9 in an array A. (How many trials to find this value?)

- Find the value 1 in an array A. (How many trials to find this value?)

Find the value 6 in an array A. (How many trials to find this value?)

If the value is found, then:

- print out the following message "The element you are looking for is found", otherwise,

- print out the following message "Sorry, but the element you are looking for is not found"

Should you sort the array before searching?

Begin Variables i,x : integer, Find: boolean; i=0, Find = false, read: x; /N =number of elements in the arrosy While (i<>

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_2

Step: 3

blur-text-image_3

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

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions