<?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[Binäre suche für 2D Punkte]]></title><description><![CDATA[<p>Ich habe eine Menge von Punkten (int x, int y), die ich mir zuerst merken möchte und dann zu einem späteren Zeitpunkt herausfinden möchte ob ein angefragter punkt (int xLater, int yLater) unter den gemerkten punkten ist oder nicht.<br />
Als code in etwa so:</p>
<pre><code>awesomeClass.add(someRandom_x, someRandom_y);

if(awesomeClass.contains(someSpecified_x, someSpecified_y)) {
   //blupp
}
</code></pre>
<p>Einen unkomplizierten Vorschlag wie man das lösen kann? Am liebsten mit Vector. Ich hatte an einen Binärbaum gedacht, nur kann man da irgendwie schlecht 2D-Punkte einsortieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/331309/binäre-suche-für-2d-punkte</link><generator>RSS for Node</generator><lastBuildDate>Fri, 01 May 2026 17:38:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/331309.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 21 Feb 2015 13:18:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Binäre suche für 2D Punkte on Sat, 21 Feb 2015 13:18:29 GMT]]></title><description><![CDATA[<p>Ich habe eine Menge von Punkten (int x, int y), die ich mir zuerst merken möchte und dann zu einem späteren Zeitpunkt herausfinden möchte ob ein angefragter punkt (int xLater, int yLater) unter den gemerkten punkten ist oder nicht.<br />
Als code in etwa so:</p>
<pre><code>awesomeClass.add(someRandom_x, someRandom_y);

if(awesomeClass.contains(someSpecified_x, someSpecified_y)) {
   //blupp
}
</code></pre>
<p>Einen unkomplizierten Vorschlag wie man das lösen kann? Am liebsten mit Vector. Ich hatte an einen Binärbaum gedacht, nur kann man da irgendwie schlecht 2D-Punkte einsortieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2443686</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2443686</guid><dc:creator><![CDATA[ProblemSteller]]></dc:creator><pubDate>Sat, 21 Feb 2015 13:18:29 GMT</pubDate></item><item><title><![CDATA[Reply to Binäre suche für 2D Punkte on Sat, 21 Feb 2015 13:30:06 GMT]]></title><description><![CDATA[<p><code>std::set</code> und <code>std::unordered_set</code> tun genau das, was du willst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2443687</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2443687</guid><dc:creator><![CDATA[m.e.]]></dc:creator><pubDate>Sat, 21 Feb 2015 13:30:06 GMT</pubDate></item><item><title><![CDATA[Reply to Binäre suche für 2D Punkte on Sat, 21 Feb 2015 13:32:47 GMT]]></title><description><![CDATA[<p>Bevor die Frage kommt, wie du zweidimensionale Objekte ins Set bekommst: <code>std::tuple</code> bzw. <code>std::pair</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2443689</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2443689</guid><dc:creator><![CDATA[m.e.]]></dc:creator><pubDate>Sat, 21 Feb 2015 13:32:47 GMT</pubDate></item><item><title><![CDATA[Reply to Binäre suche für 2D Punkte on Sat, 21 Feb 2015 13:54:09 GMT]]></title><description><![CDATA[<p>ProblemSteller schrieb:</p>
<blockquote>
<p>Ich hatte an einen Binärbaum gedacht, nur kann man da irgendwie schlecht 2D-Punkte einsortieren.</p>
</blockquote>
<p>Warum soll das nicht gehen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2443690</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2443690</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Sat, 21 Feb 2015 13:54:09 GMT</pubDate></item><item><title><![CDATA[Reply to Binäre suche für 2D Punkte on Sat, 21 Feb 2015 14:04:07 GMT]]></title><description><![CDATA[<p>manni66 schrieb:</p>
<blockquote>
<p>ProblemSteller schrieb:</p>
<blockquote>
<p>Ich hatte an einen Binärbaum gedacht, nur kann man da irgendwie schlecht 2D-Punkte einsortieren.</p>
</blockquote>
<p>Warum soll das nicht gehen?</p>
</blockquote>
<p>Man muss die punkte ja irgendwie sortieren, damit man sie im baum wiederfindet und mir kam gleich in den sinn, dass man 2d punkte nicht sortieren kann, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2443691</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2443691</guid><dc:creator><![CDATA[Problemsteller]]></dc:creator><pubDate>Sat, 21 Feb 2015 14:04:07 GMT</pubDate></item><item><title><![CDATA[Reply to Binäre suche für 2D Punkte on Sat, 21 Feb 2015 14:13:18 GMT]]></title><description><![CDATA[<p>Problemsteller schrieb:</p>
<blockquote>
<p>manni66 schrieb:</p>
<blockquote>
<p>ProblemSteller schrieb:</p>
<blockquote>
<p>Ich hatte an einen Binärbaum gedacht, nur kann man da irgendwie schlecht 2D-Punkte einsortieren.</p>
</blockquote>
<p>Warum soll das nicht gehen?</p>
</blockquote>
<p>Man muss die punkte ja irgendwie sortieren, damit man sie im baum wiederfindet und mir kam gleich in den sinn, dass man 2d punkte nicht sortieren kann, oder?</p>
</blockquote>
<p>Wie würdest du Wörter sortieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2443695</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2443695</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Sat, 21 Feb 2015 14:13:18 GMT</pubDate></item><item><title><![CDATA[Reply to Binäre suche für 2D Punkte on Sat, 21 Feb 2015 18:10:38 GMT]]></title><description><![CDATA[<p>@Problemsteller<br />
Wenn du bloss exakte Übereinstimmungen finden musst, dann ist das kein Problem.<br />
Dazu kannst du ne <code>map</code> oder ne <code>unordered_map</code> nehmen - ziemlich egal.</p>
<p>Und klar kann man 2D Koordinaten sortieren.</p>
<p>Etwas schwieriger wird es dann erst wenn du keine exakte Übereinstimmungen mehr hast, sondern anfängst benachbarte Punkte zu suchen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2443734</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2443734</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sat, 21 Feb 2015 18:10:38 GMT</pubDate></item></channel></rss>