# Optimal Algorithm for Profiling Dynamic Arrays with Finite Values

**Authors:** Dingcheng Yang, Wenjian Yu, Junhui Deng, Shenghua Liu

arXiv: 1812.05306 · 2018-12-14

## TL;DR

This paper introduces S-Profile, an optimal, constant-time algorithm for real-time profiling of dynamic arrays to identify most frequent objects, significantly outperforming existing methods in speed.

## Contribution

The paper presents S-Profile, a novel algorithm that achieves constant-time updates and optimal complexity for profiling dynamic arrays with single-element modifications.

## Key findings

- S-Profile outperforms heap-based methods with at least 2X speedup.
- S-Profile outperforms balanced tree methods with 13X or more speedup.
- The algorithm is proven to be optimal in computational complexity.

## Abstract

How can one quickly answer the most and top popular objects at any time, given a large log stream in a system of billions of users? It is equivalent to find the mode and top-frequent elements in a dynamic array corresponding to the log stream. However, most existing work either restrain the dynamic array within a sliding window, or do not take advantages of only one element can be added or removed in a log stream. Therefore, we propose a profiling algorithm, named S-Profile, which is of $O(1)$ time complexity for every updating of the dynamic array, and optimal in terms of computational complexity. With the profiling results, answering the queries on the statistics of dynamic array becomes trivial and fast. With the experiments of various settings of dynamic arrays, our accurate S-Profile algorithm outperforms the well-known methods, showing at least 2X speedup to the heap based approach and 13X or larger speedup to the balanced tree based approach.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1812.05306/full.md

## Figures

9 figures with captions in the complete paper: https://tomesphere.com/paper/1812.05306/full.md

## References

17 references — full list in the complete paper: https://tomesphere.com/paper/1812.05306/full.md

---
Source: https://tomesphere.com/paper/1812.05306