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
JulijaS [17]
4 years ago
8

Implement a sorting algorithm and sort the vocab array (found below) alphabetically. For this question, do not define or use an

explicit swap function (you will revisit this in question 3). Print the vocab array before and after it is sorted. Vocab = [ "Libraries", "Bandwidth", "Hierarchy", "Software", "Firewall", "Cybersecurity","Phishing", "Logic", "Productivity"]
Computers and Technology
1 answer:
Stolb23 [73]4 years ago
3 0

Answer:

vocab = [ "Libraries", "Bandwidth", "Hierarchy", "Software", "Firewall", "Cybersecurity","Phishing", "Logic", "Productivity"]

print(vocab)

needNextPass = True

k = 1

#list = [x.lower() for x in list]

while k < len(vocab)-1 and needNextPass:

   # List may be sorted and next pass not needed

   needNextPass = False

   for i in range(len(vocab) - k):

       if vocab[i] > vocab[i + 1]:

           # swap list[i] with list[i + 1]

           temp = vocab[i]

           vocab[i] = vocab[i + 1]

           vocab[i + 1] = temp

           needNextPass = True  # Next pass still needed

print(vocab)

Explanation:

I hope this helps you!

You might be interested in
windows 10 brought back the desktop, and gives the option to use either the start screen or desktop with a new tiled___
levacccp [35]

Answer:



A new tiled background

5 0
3 years ago
What can detect 8 colors?
Semmy [17]
The color sensor if i’m correct
8 0
3 years ago
Read 2 more answers
A computer with 5 stage pipeline like the one descrive in class delas with conditional branches by stalling for the next three c
trasher [3.6K]

Answer:

It hurts 80%

Explanation:

7 0
4 years ago
Carly wants to be able to look at a document without having to use the horizontal scroll bar located on the bottom of the screen
Leno4ka [110]

Answer:

I think it's "Carly will set the page to Page Width, and Rhianna would zoom to 150%." If Carly doesn't want to use the zoom thingy, then she probably would just change the page orentation (idk if I spelled that right). Rhianna wants to zoom in, so that's why I said that. It's either "A" or "C."

Explanation:

I hope this helps!

5 0
3 years ago
Anna is making a presentation on the solar system. She wants to emphasize the planet names as they appear one by one on the pres
Svetach [21]

slide transition effect.

5 0
3 years ago
Other questions:
  • What is the name given to the software testing technique, which basically consists of finding implementation bugs using malforme
    7·2 answers
  • Which topology enables only one person, at one time, to send data to others on the network?
    6·1 answer
  • The Internet began when a large company wanted to sell products online. True False
    15·2 answers
  • What are the three business writing formats
    12·1 answer
  • Answer ASAP and I'll give brainliest.
    10·2 answers
  • A company has four departments: A, B, C, and D. The number of IP addresses required by each department is 100, 60, 20, and 26 re
    5·1 answer
  • Stay at least _____ behind the vehicle ahead of you at all times.
    12·2 answers
  • Apply Decision Tree Algorithm on the following data:
    12·1 answer
  • Davids family took him to a hospital as he was suffering from a sericous ailment
    8·1 answer
  • Project: Digital Media and Business
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!