Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit965c288

Browse files
authored
Update DataStructure.java
1 parent37b99ff commit965c288

File tree

1 file changed

+44
-18
lines changed

1 file changed

+44
-18
lines changed

‎src/main/java/com/types/DataStructure.java

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,52 @@
66
* This interface is to define bacis functionality expected out of any implementation class
77
* Since this is a data structure it should have the flexibility to contain any kind of object hence it has been made generic
88
* Any implementation class need not to be thread safe or it could be depending on the implementation class how does it want to behave.
9+
*
910
* @param <T>
1011
*/
1112
publicinterfaceDataStructure<T>extendsIterator<T> {
1213

13-
//Method to add element in the structure
14-
publicbooleanadd(Tt);
15-
16-
//Method to remove the given object from structure
17-
publicbooleanremove(To);
18-
19-
//Method to get Iterator to parse on the given structure
20-
publicIterator<T>iterator();
21-
22-
//Method to check if structure is empty
23-
publicbooleanisEmpty();
24-
25-
//Method to get all the elements of data structure in array
26-
publicObject[]toArray();
27-
28-
//Method to get the size or number of elements in structure
29-
publicintsize();
30-
14+
/**
15+
* Method to add element in the structure
16+
*
17+
* @param t element
18+
* @return boolean
19+
*/
20+
booleanadd(Tt);
21+
22+
/**
23+
* Method to remove the given object from structure
24+
*
25+
* @param o element
26+
* @return boolean
27+
*/
28+
booleanremove(To);
29+
30+
/**
31+
* Method to get Iterator to parse on the given structure
32+
*
33+
* @return iterator
34+
*/
35+
Iterator<T>iterator();
36+
37+
/**
38+
* Method to check if structure is empty
39+
*
40+
* @return boolean
41+
*/
42+
booleanisEmpty();
43+
44+
/**
45+
* Method to get all the elements of data structure in array
46+
*
47+
* @return arr
48+
*/
49+
Object[]toArray();
50+
51+
/**
52+
* Method to get the size or number of elements in structure
53+
*
54+
* @return size
55+
*/
56+
intsize();
3157
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp