After the vector is sorted, we assume that the element with index i
correspond to the percentile 100*(i+0.5)/size. For percentiles before the
first element (resp. after the last one) we return the first element (resp.
the last). And otherwise we do a linear interpolation between the two element
around the asked percentile.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eThe \u003ccode\u003ePercentile\u003c/code\u003e class is a utility for calculating percentiles for a limited number of records, referencing the Wikipedia definition of percentile.\u003c/p\u003e\n"],["\u003cp\u003eIt assumes the sorted element with index \u003ccode\u003ei\u003c/code\u003e corresponds to the percentile \u003ccode\u003e100*(i+0.5)/size\u003c/code\u003e, performing linear interpolation for percentiles between elements.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to add records (\u003ccode\u003eAddRecord\u003c/code\u003e), retrieve a specific percentile (\u003ccode\u003eGetPercentile\u003c/code\u003e), and get the total number of records (\u003ccode\u003eNumRecords\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGetPercentile\u003c/code\u003e has a time complexity of O(n log n) for n records.\u003c/p\u003e\n"]]],["The `Percentile` class calculates percentiles for a limited number of records. It uses a sorted vector, with element index `i` corresponding to the percentile `100*(i+0.5)/size`. `AddRecord` adds a record. `GetPercentile` retrieves the percentile, using linear interpolation between elements for requested values, and it runs in O(n log n). `NumRecords` returns the count of stored records. The constructor initializes the record limit.\n"],null,[]]