I have a large amount of data that I want to have access in two ways. I would like constant time to be searched based on any key, constantly setting the time with one key and constantly deleting time with the other. Is there such a data structure and can I build it using data structures in tr1 and possibly boost it?
Use two parallel hash tables. Make sure the keys are stored inside the element value, because you will need all the keys at the time of deletion.
Bloom Filters? O (1), , , -, , , .
, , , -, 2 -. :
Hashtable inHash; Hashtable outHash; //Hello myObj example!! myObj.inKey="one"; myObj.outKey=1; myObj.data="blahblah..."; //adding stuff inHash.store(myObj.inKey,myObj.outKey); outHash.store(myObj.outKey,myObj); //deleting stuff inHash.del(myObj.inKey,myObj.outKey); outHash.del(myObj.outKey,myObj); //findin stuff //straight myObj=outHash.get(1); //the other way; still constant time key=inHash.get("one"); myObj=outHash.get(key);
, , .
: "" ... - "". , 100% std:: maps "Node *" Node ( ). ( , ).
, "" -
struct Node { Key key1; Key key2; Payload data; Node *Collision1Prev, *Collision1Next; Node *Collision2Prev, *Collision2Next; };
Node - .
. , , , , -, , .
(, , "" ), (.. , ).
Source: https://habr.com/ru/post/1782653/More articles:Why does MySQL boolean type map to tinyint instead of enum? - mysqlin Javascript / jQuery, how to check a specific part of a string and determine if it is a space or a letter? - javascriptConvert several types of documents (xls, doc, gif, png) to pdf in ruby - ruby-on-railshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1782651/different-ways-to-enumerate-a-collection&usg=ALkJrhhgYKl1am5A7JApRSnOxG9h38PYNwВозможно ли преобразовать HTML-документ в Excel с несколькими рабочими таблицами/вкладками? - htmlHow to handle security restrictions using the GWT 2.1 RequestFactory? - securityDatabase Recommendations - sqlDynamic ORM - Perl - perlDoes the char array contain a string? - cWhat is the best way to delete millions of records in TSQL? - sqlAll Articles