-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterfaz.java
More file actions
84 lines (43 loc) · 1.35 KB
/
Interfaz.java
File metadata and controls
84 lines (43 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package Hash;
//import java.util.Scanner;
public class Interfaz {
public static void main(String[] args) throws HashIsEmptyException, NonexistentKeyException {
Hash<Integer, String> h = new Hash<Integer, String>();
System.out.println("¿Esta vacia? : " + h.isEmpty());
System.out.println("¿Cual es su tamaño? : "+h.getSize());
h.put(1, "primero" );
h.put(2, "segundo" );
h.put(3, "tercero" );
h.put(4, "cuarto" );
System.out.println("¿Esta vacia? : " + h.isEmpty());
System.out.println("¿Cual es su tamaño? : "+h.getSize());
System.out.println("se eliminara al numero dos");
h.remove(2);
System.out.println("¿Cual es su tamaño? : "+h.getSize());
System.out.println("¿quien esta en dos? : " + h.get(2));
System.out.println("¿quien esta en uno? : " + h.get(1));
/* proble de hackerearth de los numeros pares funciona con esta estructura */
// Scanner s = new Scanner(System.in);
//
// int N = s.nextInt();
//
// for (int i = 0; i < N; i++) {
// int K = s.nextInt();
// String V = s.nextLine();
// h.put(K, V);
//
// }
//
// int Q = s.nextInt();
//
// for (int i = 0; i < Q; i++) {
// int x = s.nextInt();
// System.out.println(h.get(x).replaceAll(" ", ""));
//
//
//
// }
//
// s.close();
}
}