SCHOOL OF CODE BUILDERS
Learn To CODE. Become A DEVELOPER.
Pages
HOME
DATA STRUCTURES
STRINGS
ARRAYS
MATRIX
BINARY TREES
LINKED LIST
STACK
QUEUE
SORTING
SEARCHING
C
PYTHON
PSEUDOCODE
CONTEST PROBLEMS
ALGORITHMS
PATTERNS
PHP
C PUZZLES
C INTERVIEW QUESTIONS
JAVA
C++
HASHING
RECURSION
BASIC C PROGRAMS
TCS-CODEVITA
FACEBOOK
CONTACT US
Given a list of N Numbers, Sort them in Non-Decreasing Order
Given N values, how to sort the N values in Non-Decreasing Order. i.e., In Increasing Order or Ascending Order.
Python Implementation:
# Get N, the number of values to sort N = int ( raw_input () ) # Create an Empty List list = [] # While N is not "0", Get the numbers from the user while ( N > 0 ) : # Add each integer you get from the user into the list list.append ( int ( raw_input () ) ) # Decrement "N" N - = 1 # For each number in the sorted list for i in sorted ( list ) : # Print the value in the sorted list print i
PREVIOUS
NEXT
HOME