Skip to content

Commit 4d97946

Browse files
committed
feat: Table 자료구조 ADT, 인터페이스 정의
1 parent eef99ac commit 4d97946

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package table;
2+
3+
/**
4+
* 테이블 자료구조의 인터페이스, ADT
5+
*
6+
* @param <K> Key 타입에 사용될 타입 파라미터
7+
* @param <V> Value 타입에 사용될 타입 파라미터
8+
*/
9+
public interface Table<K, V> {
10+
11+
/**
12+
* 테이블에 key로 value를 저장합니다.
13+
*
14+
* @param key key 역할을 할 값
15+
* @param value value 역할을 할 값
16+
*/
17+
void insert(K key, V value);
18+
19+
/**
20+
* 테이블에 key값으로 저장되어있는 value를 찾습니다.
21+
*
22+
* @param key 검색에 사용될 key 값
23+
* @return key값에 해당하는 value, null 가능
24+
*/
25+
V search(K key);
26+
27+
/**
28+
* 테이블에 key값으로 저장되어있는 value를 찾아 테이블에서 제거하고, value를 반환합니다.
29+
*
30+
* @param key 검색에 사용될 key 값
31+
* @return key값에 해당하는 value, null 가능
32+
*/
33+
V delete(K key);
34+
}

0 commit comments

Comments
 (0)