sashaafm / exads

Algorithms and Data Structures collection in Elixir
83 stars 12 forks source link

Make Stack a tagged tuple #3

Closed NobbZ closed 8 years ago

NobbZ commented 8 years ago

That way it would provide more “typesafety” and also it would hinder users to throw in a “normal” list and use it as stack.

Also we could insert some Meta-Data to do some optimisations on other functions (eg. store the size in the tuple to make size/1 run in O(1) instead of O(n))

I can do this myself is you are okay with it @sashaafm

sashaafm commented 8 years ago

Hello again Norbert,

yes I agree with your suggestions. You're free to do it :) It will probably be best to do the same or similar to the other ADS's.