Category: data structure
Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: “Gold Medal”, “Silver Medal” and “Bronze …
Imagine a link-list data structure, given an entry, you are asked to remove the item from the list. In C/C++, you may write something like this (CAUTION: the following …
A Sparse Matrix (SM) is a popular data structure that is used to stored two-dimension Matrix when the total the empty/zero elements are the majority in the matrix. For …
Two strings are both lowercase letters. Write a function to determine if one string can be constructed using the letters from the other string. For example: canConstruct("aa", "ab") = …
In Delphi (Object Pascal), you can use the record keyword to define a C-like structure. For example, type data = record key: string; value: integer; end; It is interesting …