<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Cs-Theory on traviscj/blog</title>
    <link>https://traviscj.com/blog/tags/cs-theory/</link>
    <description>Recent content in Cs-Theory on traviscj/blog</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 13 Mar 2013 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://traviscj.com/blog/tags/cs-theory/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>implementation of set operations</title>
      <link>https://traviscj.com/blog/post/2013-03-13-implementation_of_set_operations/</link>
      <pubDate>Wed, 13 Mar 2013 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2013-03-13-implementation_of_set_operations/</guid>
      <description>&lt;p&gt;We got in a bit of a debate yesterday in the office over the implementation of associative containers, which I thought was pretty fun.&#xA;We made up the big chart of complexity results you see below.&lt;/p&gt;&#xA;&lt;h2 id=&#34;nomenclature&#34;&gt;nomenclature:&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$S$, $S_1$, and $S_2$ are subsets of $\Omega$.&lt;/li&gt;&#xA;&lt;li&gt;Denote an element by $e\in\Omega$.&lt;/li&gt;&#xA;&lt;li&gt;$n$,$n_1$,$n_2$,$N$ are the sizes of the set $S$, $S_1$, $S_2$, and $\Omega$, respectively, and $n_1 \geq n_2$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;complexity&#34;&gt;Complexity&lt;/h2&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Operation\Approach&lt;/th&gt;&#xA;          &lt;th&gt;Hash Table&lt;/th&gt;&#xA;          &lt;th&gt;Hash Tree&lt;/th&gt;&#xA;          &lt;th&gt;Binary List&lt;/th&gt;&#xA;          &lt;th&gt;Entry List (sorted)&lt;/th&gt;&#xA;          &lt;th&gt;Entry List (unsorted)&lt;/th&gt;&#xA;          &lt;th&gt;&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;$e \in S&#x9;&#x9;  $&lt;/td&gt;&#xA;          &lt;td&gt;$O(1)   &#x9;&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;$O(log(n))&#x9;&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;$O(1)&#x9;&#x9;&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;$O(log(n))&#x9;&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;$O(n)&#x9;&#x9;&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;$S_1 \cup S_2    $&lt;/td&gt;&#xA;          &lt;td&gt;$O(n_1+n_2)&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;$O(n_1+n_2)&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;$O(N)&#x9;&#x9;&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;$O(n_1+n_2)&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;$O(n_1n_2)&#x9;&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;$S_1 \cap S_2    $&lt;/td&gt;&#xA;          &lt;td&gt;$O(n_1)&#x9;&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;$O(log(n_1)n_2)$&lt;/td&gt;&#xA;          &lt;td&gt;$O(N)&#x9;&#x9;&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;$O(n_2)&#x9;&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;$O(n_1n_2)&#x9;&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;space complexity&lt;/td&gt;&#xA;          &lt;td&gt;$O(n)&#x9;&#x9;&#x9;$&lt;/td&gt;&#xA;          &lt;td&gt;$O(n)          $&lt;/td&gt;&#xA;          &lt;td&gt;$O(N)$ bits.&lt;/td&gt;&#xA;          &lt;td&gt;$O(n)          $&lt;/td&gt;&#xA;          &lt;td&gt;$O(n)          $&lt;/td&gt;&#xA;          &lt;td&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;As I said&amp;ndash;this was just what came out of my memory of an informal discussion, so I make no guarantees that any of it is correct.&#xA;Let me know if you spot something wrong!&#xA;We used the examples  $S_1 = {1,2,3,4,5}$ and $S_2 = {500000}$ to think through some things.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
