<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Eigene Map]]></title><description><![CDATA[<p>Moin Leuts,</p>
<p>ich dachte mir, aus Lernzwecken, probier ich dochmal eine eigene Map zu implementieren. Dazu dachte ich mir, da ich das noch nie gemacht habe, ich hole mir ein paar Ratschläge von euch ein. Zur internen Darstellung dachte ich mir, nutze ich std::pair. Wie würdet ihr dann aber weiter vorgehen? Soll ich die pair´s als Verkettete Liste darstellen oder wie? Halt ein paar wichtige Eindrücke von euch würden mir ganz hilfreich sein. Was ich unbedingt beachten muss...usw. Vielen Dank für eure Zeit.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/232678/eigene-map</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 05:07:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/232678.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Jan 2009 16:40:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Eigene Map on Sun, 25 Jan 2009 16:40:57 GMT]]></title><description><![CDATA[<p>Moin Leuts,</p>
<p>ich dachte mir, aus Lernzwecken, probier ich dochmal eine eigene Map zu implementieren. Dazu dachte ich mir, da ich das noch nie gemacht habe, ich hole mir ein paar Ratschläge von euch ein. Zur internen Darstellung dachte ich mir, nutze ich std::pair. Wie würdet ihr dann aber weiter vorgehen? Soll ich die pair´s als Verkettete Liste darstellen oder wie? Halt ein paar wichtige Eindrücke von euch würden mir ganz hilfreich sein. Was ich unbedingt beachten muss...usw. Vielen Dank für eure Zeit.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652116</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652116</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Sun, 25 Jan 2009 16:40:57 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Sun, 25 Jan 2009 16:44:03 GMT]]></title><description><![CDATA[<p>Schau dir vielleicht mal den <a href="http://magazin.c-plusplus.net/artikel/Bin%E4rer%20Suchbaum" rel="nofollow">Artikel über binäre Suchbäume</a> an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652118</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652118</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sun, 25 Jan 2009 16:44:03 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 07:58:47 GMT]]></title><description><![CDATA[<p>Danke dir. Gibt es eventuell noch mehr Hinweise, worauf ich wirklich achten muss? Tips?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652402</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652402</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Mon, 26 Jan 2009 07:58:47 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 11:24:03 GMT]]></title><description><![CDATA[<p>Du bist auch relativ frei, wenn du eine eigene Map gestaltest. Kriterium ist ja eigentlich nur, dass sie ständig sortiert ist und man in logarithmischer Zeit suchen kann, und das ist durch einen binären Suchbaum wunderbar gegeben. Ansonsten bei konkreten Dingen kann dir sicher auch die Implementierung der <code>std::map</code> deiner Standardbibliothek helfen. Eventuell auch <a href="http://www.cplusplus.com/reference/stl/map" rel="nofollow">www.cplusplus.com/reference/stl/map</a>.</p>
<p>Vielleicht hat ja noch jemand anders Ratschläge. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652559</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652559</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Mon, 26 Jan 2009 11:24:03 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 11:39:35 GMT]]></title><description><![CDATA[<p>Alles klar Nexus, das mit dem Binären Baum werde ich versuchen umzusetzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652566</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652566</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Mon, 26 Jan 2009 11:39:35 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 11:54:30 GMT]]></title><description><![CDATA[<p>Könnte man nicht zuerst ein eigenes Set implementieren und dann Map einfach als Adapter für das Set?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652569</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652569</guid><dc:creator><![CDATA[Don06]]></dc:creator><pubDate>Mon, 26 Jan 2009 11:54:30 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 12:08:08 GMT]]></title><description><![CDATA[<p>Don06 schrieb:</p>
<blockquote>
<p>Könnte man nicht zuerst ein eigenes Set implementieren und dann Map einfach als Adapter für das Set?</p>
</blockquote>
<p>Wie meinst du das konkret? Einfach zuerst das Set fertigstellen und dann die Map darum herum bauen? Wie würdest du dann die Elemente zuordnen?</p>
<p>Ich würde für die Knoten der Map einfach Zeiger auf Schlüssel-Wert-Paare einsetzen (z.B. <code>std::pair*</code> ).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652572</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652572</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Mon, 26 Jan 2009 12:08:08 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 12:12:45 GMT]]></title><description><![CDATA[<p>Genau, an std::pair hatte ich auch für die interne Darstellung gedacht. Was mir nur im Moment etwas zu schaffen macht, die Implementations als Baum.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652574</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652574</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Mon, 26 Jan 2009 12:12:45 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 16:39:59 GMT]]></title><description><![CDATA[<p>Ich weiß gerade nicht, ob das in dem Artikel ebenfalls beschrieben wird: Schau auch mal nach Rot-Schwarz-Baum, um einen ausgeglichenen Baum zu garantieren.</p>
<p>Gruß Kimmi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652733</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652733</guid><dc:creator><![CDATA[kimmi]]></dc:creator><pubDate>Mon, 26 Jan 2009 16:39:59 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 16:48:06 GMT]]></title><description><![CDATA[<p>Das Set wäre doch ein Template. Wenn du also ein Set mit Wertetyp std::pair anlegst und einen Komparator (?) einsetzt der nur nach dem ersten Wert im Paar sortiert, hasst du deine Map, oder liege ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652739</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652739</guid><dc:creator><![CDATA[Don06]]></dc:creator><pubDate>Mon, 26 Jan 2009 16:48:06 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 22:56:17 GMT]]></title><description><![CDATA[<p>Über den AVL-Baum haben wir zum Beispiel auch einen <a href="http://magazin.c-plusplus.net/artikel/AVL-Baum" rel="nofollow">Artikel</a>.</p>
<p>Don06, ah so hast du es gemeint. Du hast eigentlich schon Recht, allerdings wäre die Schnittstelle ein wenig anders bei einer Map. Ich weiss nicht, ob sich eine Vererbung lohnen würde...</p>
<pre><code class="language-cpp">template &lt;typename KeyType, typename ValueType&gt;
class Map : public Set&lt;std::pair&lt;KeyType, ValueType&gt; &gt;
{
    ...
};
</code></pre>
<p>Wahrscheinlich gibt es aber etwas, das dagegen spricht. Hm... Aber grundsätzlich fährt man wahrscheinlich nicht schlecht, wenn man zuerst ein Set implementiert. Falls es dann doch nicht über Vererbung gehen würde, müsste man trotzdem nicht viel Code abändern...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652933</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652933</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Mon, 26 Jan 2009 22:56:17 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 23:02:30 GMT]]></title><description><![CDATA[<p>Nexus schrieb:</p>
<blockquote>
<p>Wahrscheinlich gibt es aber etwas, das dagegen spricht.</p>
</blockquote>
<p>ja. es stimmt einfach nicht, daß eime map eine set ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652935</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Mon, 26 Jan 2009 23:02:30 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 23:09:58 GMT]]></title><description><![CDATA[<p>Hehe, an das habe ich auch gedacht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Wobei es mir vorher doch nicht so schlimm vorkam - aber eigentlich hast du Recht. Womit wir wieder mal Code duplizieren müssten... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652941</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652941</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Mon, 26 Jan 2009 23:09:58 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 23:18:20 GMT]]></title><description><![CDATA[<p>Nexus schrieb:</p>
<blockquote>
<p>Hehe, an das habe ich auch gedacht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Wobei es mir vorher doch nicht so schlimm vorkam - aber eigentlich hast du Recht. Womit wir wieder mal Code duplizieren müssten... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
</blockquote>
<p>nicht viel. fast alles wird ja an die Set weitergereicht.</p>
<pre><code class="language-cpp">template &lt;typename KeyType, typename ValueType&gt;
class Map
{
    private: 
       Set&lt;std::pair&lt;KeyType, ValueType&gt; &gt; data;
   public:
       void clear()
       {
          data.clear();
       }
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1652945</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652945</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Mon, 26 Jan 2009 23:18:20 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 23:23:55 GMT]]></title><description><![CDATA[<p>Okay, guter Vorschlag. Dann kann man auch Schnittstellenfunktionen wie <code>operator[]</code> einfach bereitstellen.</p>
<p>In Zukunft sollte ich wohl etwas länger philosophieren, bevor ich unüberlegte Dinge wie &quot;Vererbung&quot; ausspreche. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652949</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652949</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Mon, 26 Jan 2009 23:23:55 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 23:27:39 GMT]]></title><description><![CDATA[<p>Nexus schrieb:</p>
<blockquote>
<p>In Zukunft sollte ich wohl etwas länger philosophieren, bevor ich unüberlegte Dinge wie &quot;Vererbung&quot; ausspreche. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
</blockquote>
<p>och, es reicht eigentlich schon, wenn du die geschichte von herrn bebel liest. <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-75672.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-75672.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652951</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652951</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Mon, 26 Jan 2009 23:27:39 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Map on Mon, 26 Jan 2009 23:30:24 GMT]]></title><description><![CDATA[<p>Die habe ich bereits gelesen. Und ich muss sagen, sie hat echt Stil. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1652954</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1652954</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Mon, 26 Jan 2009 23:30:24 GMT</pubDate></item></channel></rss>