Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions questions/sort() method.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Coding question

## Question

Write a program that initialize an empty list, then populate the list with 20 random integers from 1 to 99. Then write a function to sort those integers in ascending order. Print the result after each step.

Sample:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To create a bit more of a challenge, you might add some restrictions on the kinds of methods that can be used to solve the problem(ex: not being allows to use Collections.sort());

my_list after generate random numbers = [3, 7, 99, 50, 77, 52, 22, 76, 55, 42, 80, 77, 63, 45, 44, 74, 96, 33, 11]

my_list after sorted = [3, 7, 11, 22, 33, 42, 44, 45, 50, 52, 55, 63, 74, 76, 77, 77, 80, 96, 99]