Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
Treeset
Browse files Browse the repository at this point in the history
  • Loading branch information
GersonLazaro committed Oct 16, 2017
1 parent c5f0011 commit e6a9d25
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@
"Java",
"Javascript"
]
},
{
"name": "Treeset",
"description": "Colección ordenada sin elementos duplicados",
"filename": "treeset",
"languages": [
"C++",
"Java"
]
}
]
}
7 changes: 7 additions & 0 deletions langs/C++/treeset
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set<int> t; // Declaración
t.insert(32); // Inserción
t.count(32); // Verificar si un elemento existe
t.empty(); // Verificar si el set está vacío
t.erase(25); // Borrar valor
t.clear(); // Borrar todo
t.size(); // Obtener tamaño
7 changes: 7 additions & 0 deletions langs/Java/treeset
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TreeSet<Integer> t = new TreeSet<Integer>(); // Declaración
t.add(32); // Inserción
t.contains(32); // Verificar si un elemento existe
t.isEmpty(); // Verificar si el TreeSet está vacío
t.remove(25); // Borrar valor
t.clear(); // Borrar todo
t.size(); //Obtener tamaño

0 comments on commit e6a9d25

Please sign in to comment.