Question

USING YOUR FULL NAME AND DATE OF BIRTH IN WORDS, perform a quicksort to arrange your...

USING YOUR FULL NAME AND DATE OF BIRTH IN WORDS, perform a quicksort to arrange your name in alphabetical order (A-Z)

full name is Godwin Owusu

date of birth is 30th march 1998

0 0
Add a comment Improve this question Transcribed image text
Answer #1

In [94]: def partition(arr, low, high): ( low-1) pivot arr[high] *for j in range(low, high): *if arr[j] < pivot: i = 1+1 *arr
def partition(arr,low,high):
   i = ( low-1 )
   pivot = arr[high]

   for j in range(low , high):
       if arr[j] < pivot:
           i = i+1
           arr[i],arr[j] = arr[j],arr[i]

   arr[i+1],arr[high] = arr[high],arr[i+1]
   return ( i+1 )
def quickSort(arr,low,high):
   if low < high:
       pi = partition(arr,low,high)
       quickSort(arr, low, pi-1)
       quickSort(arr, pi+1, high)
n=int(input())
d={}
arr=[]
for i in range(n):
text=input().split()
d[text[0]]=text[1]
arr.append(text[0])
quickSort(arr,0,n-1)
print("names in order")
for i in range(n):
print(arr[i],d[arr[i]])

Add a comment
Know the answer?
Add Answer to:
USING YOUR FULL NAME AND DATE OF BIRTH IN WORDS, perform a quicksort to arrange your...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using R -- Create a variable that stores the users for his/her full name For example:...

    Using R -- Create a variable that stores the users for his/her full name For example: Michael Chu Your code should swap the first name and last and vice versa and display the result like: Chu Michael Your code should run for any combinations of first name and last name. Hint: Research around split function in R. The separator is the space in between first and last name. No grade will be awarded if you start with two variables and...

  • USING MYSQL 5. Show the employees full name, their full address, email, job title, hire date...

    USING MYSQL 5. Show the employees full name, their full address, email, job title, hire date and salary. You must format the full name of the employee and full address. You must also format their salary to show as $20,000.00 and Format the date the hire date must show as March 24, 2019 The job title must be in alphabetical order. - - - - - - - - - - - - + - - - - - -...

  • Prepare a MARIE program to encode your full name using Unicode / ASCII characters. You should...

    Prepare a MARIE program to encode your full name using Unicode / ASCII characters. You should encode at most 5 characters for each part of your name (First Name or Last Name)– if your name is longer, you can shorten it, if it is less than 5 characters, then you can add dots ‘.’ You need to submit a MARIE file that contains code, using HEX like above, so that after assembling, your name is stored in MARIE memory

  • using lubuntu ce the following activities on your Linux virtual machine. Then complete estions. Write a script file which when executed will perform the following: First display today's date in d...

    using lubuntu ce the following activities on your Linux virtual machine. Then complete estions. Write a script file which when executed will perform the following: First display today's date in dd.mm.YYYY format (e.g. 20.04.2019). Ask user to enter a name to create a directory. Create a directory by the given directory name above. . . Ask user to enter a name to create a file. Copy the file /etc/passwd to the given filename above inside the newly created directory Copy...

  • Flame Tests & Electron Configuration Name: Date: Partners: PRE-LABORATORY QUESTIONS (For full credit show your calculations)....

    Flame Tests & Electron Configuration Name: Date: Partners: PRE-LABORATORY QUESTIONS (For full credit show your calculations). 1. List the expected color of light and the corresponding wavelength (nm) associated with each cation (use Table 1). Rubidium, Rb Cesium, Cs 2. Calculate the energy associated with the light emitted by each of the elements above (sue equations 1 and 2) Rubidium, Rb*

  • Discuss how you would configure your Linux distribution to perform name resolution using DNS. Compare and...

    Discuss how you would configure your Linux distribution to perform name resolution using DNS. Compare and contrast the following programs which are helpful in debugging TCP/IP networks: nslookup, host, dig, whois. Ensure you provide terminal output in your discussion.

  • Show your steps and clearly mark your answer(s) for full credit. Date 1. Use the Standard Normal table or a calculat...

    Show your steps and clearly mark your answer(s) for full credit. Date 1. Use the Standard Normal table or a calculator to find the z-score zo that corresponds to the cumulative area or percentile. Sketch graph of normal distribution first. (using the standard normal table, Calculator or both). a. P(Z <Zo) = 0.33 b. P(Z<Zo) = 0.7995 Zo=_ ctut Zo=_.8 ZoIinvaomaf (0.33,0,) ZoENnam ConAs, 033 c. P(Z< Zo) 0.0045 d. P(Z> Zo) 0.025 Zo=-261 Zo-1-96 2oununomal (our e. P(Z> Zo)...

  • Using the following tables write a sql command: List the full name and the total number...

    Using the following tables write a sql command: List the full name and the total number of transactions handled by the full time employee. Rank your results in descending order on the total number of transactions. Table: MEMBERS Column Data Type Length Precision Scale Nullable MEMBERID NUMBER 4 0 No MFIRST VARCHAR2 25 No MLAST VARCHAR2 25 No STREET VARCHAR2 64 No CITY VARCHAR2 25 . No STATE VARCHAR2 2 . No ZIPCODE NUMBER 0 No CREDITLIMIT NUMBER 7 2...

  • Date Student's Name Pre-Simulation Worksheet Simulated patient's Name in EHR: John Oscard Brief History: 65 y.o, ma...

    Date Student's Name Pre-Simulation Worksheet Simulated patient's Name in EHR: John Oscard Brief History: 65 y.o, male transferred to your unit from respiratory ICU. Admitted two weeks ago with exacerbation of COPD, requiring ventilator support. Tracheostomy performed day 5 of this admission for laryngeal protection. Patient weaned off ventilator 2 days ago. Remains on oxygen therapy 31% humidified via trach collar. Simulation Learning Objectives: Exhibit professional behavior at all times during the interaction with patient and family. Maintain patient and...

  • NAME SECTION DATE PREABORA 1. In your own words, define the following terms: empirical formula firing...

    NAME SECTION DATE PREABORA 1. In your own words, define the following terms: empirical formula firing to red heat beating to constant weight molecular formula weighing by difference 2. Why are the empty crucible and cover fired to red heat? 3. How critical are the suggested times for heating and cooling? 4. Why is distilled water added to the crucible after igniting the magnesium metal? 5. How can you tell when the magnesium metal has reacted completely? 6. How can...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT