Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Groups
Community ▾
A
A
Problems
/
Python Essentials
/
Searching and Sorting
Searching and Sorting
Python Programming
+ Upload a Problem
More in Python Essentials
Dictionaries
Tuples and Sets
Errors and Exceptions
Modules and Libraries
Searching and Sorting
Recursion
Text Processing
Essentials Projects
All Levels
High School (9–10)
High School (11–12)
Undergraduate
General
All
Easy
Medium
Hard
Sort
Mixed
Newest first
Oldest first
A to Z
13 problems
Type:
Any
Conceptual
Numerical
Python-Coded
1.
The marks, already sorted from the highest, are [95, 90, 90, 90, 80, 75, 75].
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Medium
2.
Bubble sort needs n * (n - 1) // 2 comparisons.
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Medium
3.
Write a function first_above(items, limit) that gives the position of the first item that is more…
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Easy
4.
Which search would you use? (a) A list of 5 names in no particular order.
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Medium
5.
In selection sort, you find the smallest value and put it first, then the smallest of the rest and…
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Hard
6.
Do one pass of bubble sort on [5, 2, 9, 1]: compare each pair of neighbours from the left and swap…
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Medium
7.
Find the median of [9, 3, 7, 5, 1] by sorting.
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Medium
8.
Find the three highest scores in [72, 85, 64, 90, 58, 77].
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Medium
9.
Sort ["banana", "fig", "cherry", "kiwi"] by length, shortest first and then longest first.
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Easy
10.
Sort ["Meera", "asha", "Kabir", "Ravi"]. Why does asha come last, and how do you fix it?
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Medium
11.
A binary search looks for 37 in the numbers from 1 to 100 (in order).
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Medium
12.
A linear search looks for 90 in [72, 85, 64, 90, 58]. How many checks does it need?
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Easy
13.
For fruits = ["apple", "mango", "kiwi", "plum"], find the position of kiwi, and test if fig is in…
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Easy