<?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[Löschen&#x2F;doublehashing]]></title><description><![CDATA[<p>Liebe Leute!</p>
<p>wollte fragen, ob ihr mir da vlt weiterhelfen könnt.</p>
<p>hab eine Hashingtabelle via doublehashing. add methode und so funktioniert alles nur scheitere ich egrade bei dem löschen der werte aus meiner tabelle.<br />
könnt ihr mir da vlt weiterhelfen wo mein fehler in der remove methode liegt?!</p>
<p>Danke schon im vorhinein</p>
<p>LG</p>
<pre><code class="language-cpp">template &lt;typename E&gt;
 void DoubleHashing&lt;E&gt;::remove ( const E e[],size_t s){

    size_t key = hashValue&lt;E&gt;(e);
    size_t pos;

	// suchen vom wert

    pos = key % nmax;

	if(status[pos]==filled &amp;&amp; values[pos] == e) {status[pos] = emptyagain;}

		else{

			size_t newpos;

			size_t seckey= 2*((hashValue&lt;E&gt;(e))%10)+1;
			newpos = (pos + seckey) % nmax;

				while(status[newpos] == empty &amp;&amp; values[newpos]!=e){

                                     if((status[newpos] == filled)&amp;&amp;(values[newpos] == e)){ status[newpos]=emptyagain;}
                                                         else{newpos = (newpos + seckey) % nmax;};

					status[newpos] = emptyagain;

				}		

		}

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/304170/löschen-doublehashing</link><generator>RSS for Node</generator><lastBuildDate>Mon, 10 Aug 2026 00:49:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/304170.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 31 May 2012 09:03:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Löschen&#x2F;doublehashing on Thu, 31 May 2012 09:03:32 GMT]]></title><description><![CDATA[<p>Liebe Leute!</p>
<p>wollte fragen, ob ihr mir da vlt weiterhelfen könnt.</p>
<p>hab eine Hashingtabelle via doublehashing. add methode und so funktioniert alles nur scheitere ich egrade bei dem löschen der werte aus meiner tabelle.<br />
könnt ihr mir da vlt weiterhelfen wo mein fehler in der remove methode liegt?!</p>
<p>Danke schon im vorhinein</p>
<p>LG</p>
<pre><code class="language-cpp">template &lt;typename E&gt;
 void DoubleHashing&lt;E&gt;::remove ( const E e[],size_t s){

    size_t key = hashValue&lt;E&gt;(e);
    size_t pos;

	// suchen vom wert

    pos = key % nmax;

	if(status[pos]==filled &amp;&amp; values[pos] == e) {status[pos] = emptyagain;}

		else{

			size_t newpos;

			size_t seckey= 2*((hashValue&lt;E&gt;(e))%10)+1;
			newpos = (pos + seckey) % nmax;

				while(status[newpos] == empty &amp;&amp; values[newpos]!=e){

                                     if((status[newpos] == filled)&amp;&amp;(values[newpos] == e)){ status[newpos]=emptyagain;}
                                                         else{newpos = (newpos + seckey) % nmax;};

					status[newpos] = emptyagain;

				}		

		}

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2217613</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2217613</guid><dc:creator><![CDATA[pepschi]]></dc:creator><pubDate>Thu, 31 May 2012 09:03:32 GMT</pubDate></item><item><title><![CDATA[Reply to Löschen&#x2F;doublehashing on Thu, 31 May 2012 10:07:26 GMT]]></title><description><![CDATA[<p>Glaskugel sagt <code>status[newpos] == empty</code> in der while-Bedingung muss <code>status[newpos] != empty</code> heissen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2217654</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2217654</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Thu, 31 May 2012 10:07:26 GMT</pubDate></item><item><title><![CDATA[Reply to Löschen&#x2F;doublehashing on Thu, 31 May 2012 12:08:52 GMT]]></title><description><![CDATA[<p>hustbaer schrieb:</p>
<blockquote>
<p>Glaskugel sagt <code>status[newpos] == empty</code> in der while-Bedingung muss <code>status[newpos] != empty</code> heissen.</p>
</blockquote>
<p>ja ok ist geändert jedoch schreibt mir der Compilier diese fehlermeldung:</p>
<p>invalid conversion from `const int*' to `int'<br />
initializing argument 1 of `long unsigned int hashValue(const E&amp;) [with E = int]'</p>
<p>das wäre diese zeile:</p>
<p>size_t key = hashValue&lt;E&gt;(e);<br />
size_t seckey= 2*((hashValue&lt;E&gt;(e))%10)+1;</p>
<p>keine Ahnung warum! :S</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2217711</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2217711</guid><dc:creator><![CDATA[pepschi]]></dc:creator><pubDate>Thu, 31 May 2012 12:08:52 GMT</pubDate></item><item><title><![CDATA[Reply to Löschen&#x2F;doublehashing on Thu, 31 May 2012 12:21:11 GMT]]></title><description><![CDATA[<p>pepschi schrieb:</p>
<blockquote>
<p>hustbaer schrieb:</p>
<blockquote>
<p>Glaskugel sagt <code>status[newpos] == empty</code> in der while-Bedingung muss <code>status[newpos] != empty</code> heissen.</p>
</blockquote>
<p>ja ok ist geändert jedoch schreibt mir der Compilier diese fehlermeldung:</p>
</blockquote>
<p>Und weißt du, warum dir hustbaer eine ganz andere Antwort gegeben hat? Weil deine Frage nichts taugt. Einfach bloß ein bisschen Code mit der Beschreibung &quot;ist ein Fehler drin&quot; ist keine Frage. Lies dir bitte mal den ersten und den dritten Link in meiner Signatur durch, wie man freiwilligen(!) Helfern durch eine gute Fragestellung möglichst gut entgegen kommt, so dass diese ihre Zeit nicht mit Problemen verschwenden, die gar keine sind.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2217715</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2217715</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 31 May 2012 12:21:11 GMT</pubDate></item><item><title><![CDATA[Reply to Löschen&#x2F;doublehashing on Thu, 31 May 2012 13:08:54 GMT]]></title><description><![CDATA[<p>pepschi schrieb:</p>
<blockquote>
<p>hustbaer schrieb:</p>
<blockquote>
<p>Glaskugel sagt <code>status[newpos] == empty</code> in der while-Bedingung muss <code>status[newpos] != empty</code> heissen.</p>
</blockquote>
<p>ja ok ist geändert jedoch schreibt mir der Compilier diese fehlermeldung:</p>
<p>invalid conversion from `const int*' to `int'<br />
initializing argument 1 of `long unsigned int hashValue(const E&amp;) [with E = int]'</p>
</blockquote>
<p>Jo. Natürlich tut er das.<br />
Jetzt wäre halt irgendwann angesagt C++ zu lernen.<br />
Oder willst du wegen jeder Zeile fragen?</p>
<p>Tip: Guck dir mal die Signatur der &quot;remove&quot; Funktion an, und vergleich die mit der Signatur der anderen Funktionen.<br />
Und wenn du nicht weisst was Signatur bedeutet, dann google es.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2217748</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2217748</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Thu, 31 May 2012 13:08:54 GMT</pubDate></item></channel></rss>