Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Convert pseudo code to java code using List ls Problem 1- n

Convert pseudo code to java code using List ls

Problem 1-

n <-- length(A)

for i = 0 to n-1 exclusive do

min <-- i

for j = i+1 to n exclusive do

if A[j] < A[min]

min <-- j

end if

end for

if min != i

swap(A[i], A[min])

Problem 2

n <-- length(A)

while n > 0

nn <-- 0

for i = 1 to n-1 inclusive do

if A[i-1] > A[i] then

swap(A[i-1], A[i])

nn <-- i

end if

end for

n <-- nn

Problem 3

i <-- 1

while i < length(A)

x <-- A[i]

j <-- i - 1

while j >= 0 and A[j] > x

A[j+1] <-- A[j]

j <-- j - 1

end while

A[j+1] <-- x

i <-- i + 1

end while

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

List and explain four key issues in designing a questionnaire.

Answered: 1 week ago

Question

sketch the graph of the piecewise-defined function, f(x)={2 if x

Answered: 1 week ago

Question

Know how to use reservations systems to inventory demand.

Answered: 1 week ago

Question

Convert pseudo code to java code using List ls Problem 1- n

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago