Skip to content

Commit

Permalink
GH-282: Set in General (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
rain1024 authored Apr 3, 2023
1 parent 72018af commit eee8dfc
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 8 deletions.
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

0 comments on commit eee8dfc

Please sign in to comment.