Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Andreas Leitgeb Newsgroups: comp.lang.java.programmer Subject: Re: Wanted: List of intervals Date: Sat, 11 Mar 2017 21:47:23 -0000 (UTC) Organization: A noiseless patient Spider Lines: 12 Message-ID: References: <6jjvbc1irodjda97u74rd9e855hm75oqd1@4ax.com> Reply-To: avl@logic.at Injection-Date: Sat, 11 Mar 2017 21:47:23 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="1bc074675770fea8a1c42af43cf28d81"; logging-data="1069"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18gZ75422qIbCC76C2WQo+X" User-Agent: slrn/1.0.2 (Linux) Cancel-Lock: sha1:PrTEAlau8gPb7ACmPwWQS40FfLE= Xref: csiph.com comp.lang.java.programmer:36403 Volker Borchert wrote: > Andreas Leitgeb wrote: >> Volker Borchert wrote: >> > Yes. If I understood it correctly, it's somewhat similar to a "trie"? >> In a way, yes. >> The other nice aspect is, that by toggling duplicate entries, you get >> merged intervals on insertion without extra effort. > With your set, toggle() would do the "if (!remove()) add()" > efficiently. Yes, by not having to navigate the structure twice, each time...