Database Index

According to WIKIPEDIA, a database index is a data structure that improves the speed of data retrieval on a database table at the cost of additional writes and storage space to maintain the index. One of the most used data structure to implement index is B-tree. Generally, there are two types of index: clustered index and non-clustered index.

Continue reading “Database Index”

[Leetcode]1626. Best Team With No Conflicts

You are the manager of a basketball team. For the upcoming tournament, you want to choose the team with the highest overall score. The score of the team is the sum of scores of all the players in the team.
However, the basketball team is not allowed to have conflicts. A conflict exists if a younger player has a strictly higher score than an older player. A conflict does not occur between players of the same age.
Given two lists, scores and ages, where each scores[i] and ages[i] represents the score and age of the ith player, respectively, return the highest overall score of all possible basketball teams.
Continue reading “[Leetcode]1626. Best Team With No Conflicts”