1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mr_godi [17]
3 years ago
13

Write bubblesort algorithm using random programming language

Computers and Technology
2 answers:
melamori03 [73]3 years ago
7 0

Answer:

def bubbleSort( theSeq ):

   n = len( theSeq )

   for i in range( n - 1 ) :

       flag = 0

       for j in range(n - 1) :

           

           if theSeq[j] > theSeq[j + 1] :  

               tmp = theSeq[j]

               theSeq[j] = theSeq[j + 1]

               theSeq[j + 1] = tmp

               flag = 1

       if flag == 0:

           break

   return theSeq

el = [21,6,9,33,3]  

result = bubbleSort(el)

print (result)

maks197457 [2]3 years ago
3 0

Answer:

   n := length(A)

   repeat

       swapped := false

       for i := 1 to n-1 inclusive do

          <em> /* if this pair is out of order */</em>

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

<em>                /* swap them and remember something changed */</em>

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

               swapped := true

           end if ⇒

       end for

   until not swapped

end procedure

\\

Explanation:

This is pseudocode

You might be interested in
What is the FaFASA4caster used for
pav-90 [236]

Answer:

The FAFSA4caster is a free financial aid tool from the federal government that allows you to practice filling out the Free Application for Federal Student Aid (FAFSA) and estimate the financial aid you could receive based on student and family assets and income.

6 0
3 years ago
Software piracy is acceptable as it helps us obtain software cheaper or sometimes even for free.
mr Goodwill [35]

Answer:

1: false because it's just scams

2: true

Explanation:

3 0
3 years ago
_______________________ is a short-term program, typically 30 hours long, in which a therapist, social worker, or trained probat
Semenov [28]

Answer:

Functional Family Therapy

Explanation:

According to my research on different types of therapies, I can say that based on the information provided within the question the therapy being described in this scenario is called Functional Family Therapy. This is a type of therapy aimed at young teens roughly aged 11-18 who are exhibiting violent or negative behaviors and/or substance abuse. The therapist sits down with the child, their parents, and sometimes an officer of the law in order to get to the root of the problem and come up with different solutions that may help the child feel less angry and prone to act out.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

3 0
3 years ago
A
tensa zangetsu [6.8K]
34 because its 34 ;)
8 0
3 years ago
One random part of Chess is whether the white side or the black side moves first? A. True B. False
ohaa [14]
The correct answer is B. false.
Determining which color goes first is not random at all - it is a rule in chess that the White player will always start the game first, and will then be followed by the Black player. 
5 0
3 years ago
Read 2 more answers
Other questions:
  • A bug collector collects bugs every day for 5 days. Write a program that keeps a running total of the number of bugs collected d
    12·1 answer
  • What does OLE stand for? Object
    8·2 answers
  • Which method deletes a footer from a document?
    9·2 answers
  • Can multiple processors can be installed in a single processor housing?
    14·2 answers
  • Write a C program to calculate and display the coordinates of midpoint - M of a linesegment between two given points - say A and
    7·1 answer
  • CLICK ME IF U DARE hehehe
    10·2 answers
  • Https://www.blooket.com/play?id=300932<br> please
    8·2 answers
  • Which one way in which using infrared in game console controllers could affect the experience of a person playing the game?
    8·1 answer
  • Arrange the computers in the order fastest to slowest: Minicomputer, Supercomputer, Personal Computer and Mainframe.
    9·1 answer
  • A user can add color to a database to highlight a modification. To do this with a macro, which command screen would you access o
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!