Python Interview Question: Sort the dictionary by values in ascending order |Dictionary|Bubble Sort

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 10

  • @MegaWarriors24
    @MegaWarriors24 10 місяців тому

    i got the same ques in deloitte .answered somehow but if i have seen this vdo i wouldve given the answer convincingly

    • @sumitkumar2955
      @sumitkumar2955  10 місяців тому

      Thanks for your feedback.
      All the best for your interview preparation.
      I am gathering interview questions and I will keep uploading.
      Please share with your friends and colleagues,it will be helpful.
      Thanks for watching

  • @warrior9117
    @warrior9117 9 місяців тому

    print all the zero in the end of the list was the question. So can we do this like i have done in interview for 3 year experience data engineer?
    arr = [4,0,8,2,3,0,56,0,2,78,34]
    non_zero=[]
    zero=[]
    for i in arr:
    if i==0:
    zero.append(i)
    else:
    non_zero.append(i)
    result=non_zero+zero
    print(result)

    • @sumitkumar2955
      @sumitkumar2955  9 місяців тому

      Yes , you can do it this way.
      If you are looking for a job please let me know.
      My company is looking for DE for 3 years experience.
      Skills:- PYTHON,SQL, AWS

    • @warrior9117
      @warrior9117 9 місяців тому

      i am not in aws@@sumitkumar2955 😄

  • @warrior9117
    @warrior9117 10 місяців тому

    how to do it without any predefined functions

    • @sumitkumar2955
      @sumitkumar2955  9 місяців тому

      We can do it using bubble sort.
      Please check my solution at the end

    • @warrior9117
      @warrior9117 9 місяців тому

      @@sumitkumar2955 can you make a seperate video and explain how everything works in bubble sort ?

    • @sumitkumar2955
      @sumitkumar2955  9 місяців тому

      @@warrior9117 sure I will upload ASAP, thanks 👍

    • @warrior9117
      @warrior9117 9 місяців тому

      thanks@@sumitkumar2955