From b2a7bbf1fa26487bcc1a8124f3c53d60ba849081 Mon Sep 17 00:00:00 2001 From: Raman Pandey Date: Tue, 19 Nov 2024 11:53:54 +0530 Subject: [PATCH 1/2] ISE MERGE KAR DO --- raman.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 raman.py diff --git a/raman.py b/raman.py new file mode 100644 index 0000000..e69de29 From 182ac9b14289a0086913f1a3726bf55abe466943 Mon Sep 17 00:00:00 2001 From: Raman Pandey Date: Tue, 19 Nov 2024 11:55:10 +0530 Subject: [PATCH 2/2] ISE MERGE KAR DO --- raman.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/raman.py b/raman.py index e69de29..9fcee4c 100644 --- a/raman.py +++ b/raman.py @@ -0,0 +1,30 @@ +##SORT WITHOUT SORTING +"""Given a list of integers, complete the function sorted_list(list_of_integers) that returns a list with the same integers arranged in non-decreasing order. Non-decreasing order means that each number in the list is followed by a number that is either the same or larger (in other words, from smallest to largest, with repeats allowed). For example, [3, 1, 4, 2, 2] in non-decreasing order would be [1, 2, 2, 3, 4]. + +Note: You are not allowed to use Python's built-in sort() or sorted() functions; instead, implement your own sorting logic to arrange the elements in non-decreasing order. +Input +The first and only line consists of space separated Integers representing the required list. + +Note: No need to use input() for taking input. It's already done by checker. + +Constraints: +1<= size of list<=1000 +1<=elements in list<=106 +Output +Print the given space separated integers in non-decreasing order. + +Note: You just need to return, No need to use print() for printing output. It's already done by checker. +Example +Input: +5 6 10 1 2 4 2 + +Output: +1 2 2 4 5 6 10""" + +def sorted_list(list_of_integers): + sor=[] + while list_of_integers!=[]: + temp=min(list_of_integers) + sor.append(temp) + list_of_integers.remove(temp) + return sor \ No newline at end of file