1.0 KiB
1.0 KiB
Hints
1. Define the GbTree external type
- External types can be defined using the
pub type TypeName(a, b, c)syntax.
2. Define the new_gb_tree function
- External functions can be defined using the
@external(erlang, "module", "function")syntax. - The function should use the
gb_trees:empty/0.
3. Define the insert function
- Check the
gb_trees:insert/3documentation to confirm the correct order of arguments. - The external function can be a private function that is called by the
insertfunction in order to change the order of the arguments. - The function should use the
gb_trees:insert/3.
4. Define the delete function
- Check the
gb_trees:delete_any/2documentation to confirm the correct order of arguments. - The external function can be a private function that is called by the
deletefunction in order to change the order of the arguments. - The function should use the
gb_trees:delete_any/2. - The
gb_trees:delete/2function will crash if the key is not found, so it should not be used.