Skip to content

Commit

Permalink
Map Basics
Browse files Browse the repository at this point in the history
  • Loading branch information
liusishan committed Feb 21, 2019
1 parent 0837131 commit 4fac9a0
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
16 changes: 8 additions & 8 deletions 06-Binary-Search-Tree/01-Binary-Search-Tree-Basics/src/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ public class Main {
public static void main(String[] args) {

BST<Integer> bst = new BST<>();
int[] nums = {3, 4, 5, 2, 8, 4};
int[] nums = {5, 6, 3, 8, 4, 2};
for (int num : nums)
bst.add(num);

bst.levelOrder();
// bst.inOrder();
// System.out.println();
// bst.levelOrder();
bst.inOrder();
System.out.println();
//
// bst.postOrder();
// System.out.println();
bst.postOrder();
System.out.println();
// bst.preOrderNR();
// System.out.println();
// bst.preOrder();
// System.out.println(bst);
bst.preOrder();
System.out.println();
}
}
11 changes: 11 additions & 0 deletions 07-Set-and-Map/03-Map-Basics/src/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @Auther: lss
* @Date: 2019/1/31 21:50
* @Description:
*/
public class Main {
public static void main(String[] args) {


}
}
21 changes: 21 additions & 0 deletions 07-Set-and-Map/03-Map-Basics/src/Map.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @Auther: lss
* @Date: 2019/2/21 15:34
* @Description:
*/
public interface Map<K, V> {

void add(K key, V value);

V remove(K key);

boolean contains(K key);

V get(K key);

void set(K key, V value);

int getSize();

boolean isEmpty();
}

0 comments on commit 4fac9a0

Please sign in to comment.