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
CPU BENCHMARKS are measurements used to compare performance between processors
Troyanec [42]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

CPU benchmarks are used to picking the best CPU. If you want to pick the best CPU for the kind of work you do is easier if you research some performance benchmarks.

As you know, CPU benchmarks are measurements used to compare performance between processors. These benchmarks are the measure to know the performance of CPU.

These CPU Benchmarks are generated by running software programs specifically designed to push the limits of CPU performance.

3 0
3 years ago
Dyn is a cloud-based internet performance management company that provides DNS services for internet websites. It was attacked w
notsponge [240]

Answer: ......

Explanation: yes

8 0
3 years ago
PLEASE HELP THIS WAS DUE YESTERDAY AND I DIDN'T GET TO IT IN TIME!!!!!!
kykrilka [37]

Answer:

dDAgv

Explanation:

sdc sdc sdc trust me

7 0
3 years ago
Writing anything that comes to mind that may relate to your personal essay is called:
sammy [17]
My life career in computer science
7 0
3 years ago
Read 2 more answers
Matt expects to get his first paycheck today. What deductions may be listed on his paycheck stub?
Bingel [31]
Social security
Also if he has any taxs they will be deducted
4 0
3 years ago
Other questions:
  • Your brother is starting 9th grade next year and is thinking about going to college. What step would you recommend he take?
    14·1 answer
  • The place where one printed page ends and the next page begins.
    15·1 answer
  • Instructions:Type the correct answer in the box. Spell all words correctly.
    14·2 answers
  • While performing an automatic transmission service at 60,000 miles, the technician notices a grayish sludge on the magnet in the
    15·1 answer
  • Write a program that dose the following:
    9·1 answer
  • Given an char variable last that has been initialized to a lowercase letter, write a loop that displays all possible combination
    8·1 answer
  • Which step in the software development life cycle analyzes the scope of work?
    6·1 answer
  • What is white light?
    12·2 answers
  • The factors of power of device
    10·1 answer
  • After creating a webpage with html code, what do you need to do so that others can access it on the internet?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!