Skip to content

Implement set #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 13, 2023
Merged

Implement set #29

merged 2 commits into from
Oct 13, 2023

Conversation

zegabr
Copy link
Contributor

@zegabr zegabr commented Oct 12, 2023

Description

Add Set implementation

Related Issues

Closes #24

Checklist

  • I have tested this code.
  • I have reviewed the code changes.
  • I have updated the documentation.
  • This PR follows the coding standards.
  • I have added tests for the changes.

@zegabr
Copy link
Contributor Author

zegabr commented Oct 12, 2023

I've implemented most of the methods I found on the List implementation. But as this is a Set implementation, what do you think of implementing some Set operations like:

Union(s1, s2) -> returns a new set as the union of both sets
Intersection(s1, s2) -> returns a new set with elements that exist in both sets
Disjunction(s1, s2) -> returns a new set with the elements that don't exist in both sets

@zegabr zegabr marked this pull request as ready for review October 12, 2023 03:00
@zegabr
Copy link
Contributor Author

zegabr commented Oct 12, 2023

Another thing: Considering this thread, as far as I understood, the capacity property on the map initializations don't guarantee it to be able to store as much as capacity elements without it being resized. So I omitted it from the Set initializations.

Let me know if you agree with that.

@adarsh-a-tw
Copy link
Collaborator

I've implemented most of the methods I found on the List implementation. But as this is a Set implementation, what do you think of implementing some Set operations like:

Union(s1, s2) -> returns a new set as the union of both sets Intersection(s1, s2) -> returns a new set with elements that exist in both sets Disjunction(s1, s2) -> returns a new set with the elements that don't exist in both sets

That's a great idea. But, let's not bring it into this issue. We can create a separate issue for that.

Copy link
Collaborator

@adarsh-a-tw adarsh-a-tw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! @zegabr Thanks for your contribution.

We can merge it once other codeowners approve it.

@zegabr
Copy link
Contributor Author

zegabr commented Oct 12, 2023

That's a great idea. But, let's not bring it into this issue. We can create a separate issue for that.

Got it. Feel free to also assign it to me :)

@adarsh-a-tw adarsh-a-tw merged commit b855389 into gopher-utils:main Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Set
4 participants