Skip to content

Merlin-ua/count-unique

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intro

This repository contains a solution to the following problem:

having N numbers a_1, ..., a_N do preprocessing in O(NlogN) time and then answer the following question in O(logN) time: how many different (unique) numbers are there amoung a_x, ..., a_y for arbitrary [x, y].

Solution

Proposed solution uses "rope" data structure with implementation suggested by Eugene Kirpichov.

About

Rope data structure usage example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published