Data Structure
SWE · Quiz · Summer 25
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
Question 01:
You are working as a game developer for an online multiplayer battle royale game. The game maintains an unsorted leaderboard of player scores. So, you can sort it using the Bubble Sort algorithm. Now write the Bubble Sort algorithm and its time complexity.
Question 02: (Related to Question 01)
The game now maintains a sorted leaderboard of player scores, where higher scores indicate better performance. A new player finishes a match and earns a score. For example,
scores = [2000, 1800, 1700, 1600, 1500]
playerScore = 1650
Now, your task is to determine their rank on the leaderboard using an efficient searching technique. Show the step-by-step process of how this searching technique can determine the rank (The score 1650 would be ranked 4th).