Rust

HashSet & BTreeMap

Në shqip përdoret i njëjti emër.

ShpjegimiSQ

HashSet ruan elemente unike pa renditje; BTreeMap dhe BTreeSet i mbajnë gjithmonë të renditura sipas çelësit — të dobishme kur të duhet renditje ose kërkim sipas intervalit.

EnglishEN

HashSet stores unique items without order; BTreeMap and BTreeSet always keep them sorted by key — useful when you need ordering or range lookups.

Si ta mendosh

Si një listë pjesëmarrësish pa përsëritje, ose një fjalor i renditur alfabetikisht.

Lexoje në anglisht

Like an attendee list without repeats, or an alphabetically sorted dictionary.

Shembull kodirust

let mut fjalet = BTreeMap::new();
fjalet.insert("zinxhir", 1);
fjalet.insert("algoritëm", 2);
for (f, _) in &fjalet { println!("{f}"); }   // alfabetikisht

Terma të lidhur