Tracks
/
Julia
Julia
/
Exercises
/
Custom Set
Custom Set

Custom Set

Hard

Instructions

Create a custom set type.

Sometimes it is necessary to define a custom data structure of some type, like a set. In this exercise you will define your own set. How it works internally doesn't matter, as long as it behaves like a set of unique elements.

The tests require a constructor that takes an array. The internals of your custom set implementation can use other data structures but you may have to implement an outer constructor that takes exactly one array for the tests to pass.

Certain methods have a unicode operator equivalent. E.g. intersect(CustomSet([1, 2, 3, 4]), CustomSet([])) is equivalent to CustomSet([1, 2, 3, 4]) ∩ CustomSet([]).

Edit via GitHub The link opens in a new window or tab
Julia Exercism

Ready to start Custom Set?

Sign up to Exercism to learn and master Julia with 82 exercises, and real human mentoring, all for free.