Computer Science, asked by aylab3249, 2 months ago

Write a program to sort a dictionarys values using bubble sort and produce the sorted values as a list.

Answers

Answered by rohith7386
1
Hope this helps you
Attachments:
Answered by prakharagrawal6055
0

Answer:

dic = eval (input("Enter a dictionary : "))

key = list(dic.keys())

for i in range ( len ( key ) - 1 ) :

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

       key [ i ] , key [ i + 1 ] =  key [ i + 1 ] , key [ i ]

print(key)

Explanation:

Similar questions