diff --git a/README.md b/README.md index a5eaf227..4e6268c4 100644 --- a/README.md +++ b/README.md @@ -84,10 +84,8 @@ A data structure is a data organization, management, and storage format that is Queue
  • -B Set -cpp🐀 -py🐍 -ts +B +Set
  • B Hash Table diff --git a/concepts/cpp/set.md b/concepts/cpp/set/README.md similarity index 100% rename from concepts/cpp/set.md rename to concepts/cpp/set/README.md diff --git a/concepts/general/set/README.md b/concepts/general/set/README.md new file mode 100644 index 00000000..b39044c9 --- /dev/null +++ b/concepts/general/set/README.md @@ -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 \ No newline at end of file diff --git a/concepts/python/sets.md b/concepts/python/set/README.md similarity index 99% rename from concepts/python/sets.md rename to concepts/python/set/README.md index 91786633..12bf68fa 100644 --- a/concepts/python/sets.md +++ b/concepts/python/set/README.md @@ -1,4 +1,4 @@ -# Sets +# Set From wikipedia diff --git a/concepts/typescript/set.md b/concepts/typescript/set/README.md similarity index 100% rename from concepts/typescript/set.md rename to concepts/typescript/set/README.md diff --git a/readme/cpp/README.md b/readme/cpp/README.md index a5b6f655..a596f247 100644 --- a/readme/cpp/README.md +++ b/readme/cpp/README.md @@ -39,7 +39,7 @@ A data structure is a data organization, management, and storage format that is
  • B -Set +Set
  • B diff --git a/readme/python/README.md b/readme/python/README.md index bbc0dc7a..85e0bd22 100644 --- a/readme/python/README.md +++ b/readme/python/README.md @@ -40,7 +40,7 @@ A data structure is a data organization, management, and storage format that is
  • B -Set +Set
  • B diff --git a/readme/typescript/README.md b/readme/typescript/README.md index 5dbc9147..93efce1b 100644 --- a/readme/typescript/README.md +++ b/readme/typescript/README.md @@ -40,7 +40,7 @@ A data structure is a data organization, management, and storage format that is
  • B -Set +Set
  • B Hash Table