Skip to content

GH-282: Set in General #283

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 5 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ A data structure is a data organization, management, and storage format that is
<a href="/concepts/general/queue/README.md">Queue</a>
</li>
<li>
<code>B</code> Set
<a href="/concepts/cpp/set.md"><code>cpp🐀</code></a>
<a href="/concepts/python/sets.md"><code>py🐍</code></a>
<a href="/concepts/typescript/set.md"><code>ts</code></a>
<code>B</code>
<a href="/concepts/general/set/README.md">Set</a>
</li>
<li>
<code>B</code> Hash Table
Expand Down
File renamed without changes.
26 changes: 26 additions & 0 deletions concepts/general/set/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Set

*See implementation in*
[C++](/concepts/cpp/set/README.md),
Java,
[Python](/concepts/python/set/README.md),
[Typescript](/concepts/typescript/set/README.md)

In computer science, a set is an abstract data type that can store certain values, without any particular order, and no repeated values, with two main operations: `Add`, which adds a value to the set, and `Contains`, which checks if a value is in the set.

## Set Operations

Here are some basic operations that you can perform on set:

* `Add`: Add a value to the set
* `Contains`: Check if a value is in the set
* `Remove`: Remove a value from the set
* `Union`: Return a new set that contains all the elements of the first set and the second set
* `Intersection`: Return a new set that contains only the elements that are present in both sets
* `Difference`: Return a new set that contains only the elements that are present in the first set and not in the second set


## 🔗 Further Reading

* [Set (abstract data type)](https://en.wikipedia.org/wiki/Set_(abstract_data_type)), wikipedia
* ▶️ [Set in C++ STL](https://www.youtube.com/watch?v=4FJrP6aAwSs&ab_channel=Codevolution), GeeksforGeeks
2 changes: 1 addition & 1 deletion concepts/python/sets.md → concepts/python/set/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sets
# Set

From wikipedia

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion readme/cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ A data structure is a data organization, management, and storage format that is
</li>
<li>
<code>B</code>
<a href="/concepts/cpp/set.md">Set</a>
<a href="/concepts/cpp/set/README.md">Set</a>
</li>
<li>
<code>B</code>
Expand Down
2 changes: 1 addition & 1 deletion readme/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ A data structure is a data organization, management, and storage format that is
</li>
<li>
<code>B</code>
<a href="/concepts/python/sets.md">Set</a>
<a href="/concepts/python/set/README.md">Set</a>
</li>
<li>
<code>B</code>
Expand Down
2 changes: 1 addition & 1 deletion readme/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ A data structure is a data organization, management, and storage format that is
</li>
<li>
<code>B</code>
<a href="/concepts/typescript/set.md">Set</a>
<a href="/concepts/typescript/set/README.md">Set</a>
</li>
<li>
<code>B</code> Hash Table
Expand Down