Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 1.19 KB

6.md

File metadata and controls

31 lines (19 loc) · 1.19 KB

Crates, Modules and Common Collections

Packages, Crates, Modules

  1. packages: allows us to build test and share crates, it is one or more crates that would provide functionality
  2. crates: are a tree of modules that produces a library or an executable, they are about code sharing between projects.
  3. modules: let us control the organization, scope and privacy of pass, they are about code sharing within a project
  4. pass: are a way of naming an item such as Struct, Function or module

Collections

collections are data structures that allow you to store and manipulate multiple values of the same or different types. eg vector. some more collections include.

Binary Heaps

a binary heap is a collection whose elements is loosely organized, the greatest value is always up-front

Maps

maps are collections of key pair values, and each key in the map must be unique. rust has hash maps and binary tree maps

  • hash maps are stored in a single heap allocated table
  • binary trees maps are stored in tree like structure growing from top to down to what is known as nodes

Sets

sets can be used to quickly check if a value exists. sets cannot contain duplicates

  • hash sets
  • binary tree sets