Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. public class IntSetImpl implements IntSet {
  2.  
  3. private List<int> conjunto; //lista de inteiros
  4.  
  5. IntSetImpl ( ) {
  6.  
  7. this.conjunto = new ArrayList <int>(); //crio nova lista de inteiros vazia
  8.  
  9. }
  10.  
  11.  
  12. void insert ( int x ) {
  13. this.conjunto.add(x);
  14. }
  15. void insertAll ( int [ ] v ){
  16. int count = 0;
  17. while (count < v.size ) {
  18. insert(v[count]);
  19. count++;
  20. }
  21.  
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement