Skip to content

Conversation

@amira921
Copy link
Owner

No description provided.

@@ -0,0 +1,69 @@
import java.util.*;

public class Linked_Hash_Set {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of class shoudn't contain special characters


public class Linked_Hash_Set {
public static void main(String[] args) {
LinkedHashSet_operations operations = new LinkedHashSet_operations();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the variable name shouldn't contains special character only when it's constant variable

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print some text to make the user know how to use the application and what to do next
for example
Enter the number of test cases
Enter the number of queries
etc

Comment on lines 18 to 41
switch (operation) {
case "a":
number = scan.nextInt();
operations.addValue(number);
break;

case "b":
operations.printSortedSet();
break;

case "c":
number = scan.nextInt();
operations.removeElement(number);
break;

case "d":
number = scan.nextInt();
operations.findNumber(number);
break;

case "e":
operations.getSize();
break;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract to a new method and also handle when user enter the f
aslo what if user entered a letter that doesn't exist

@@ -0,0 +1,66 @@
import java.util.*;

public class Tree_Map {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here also the class name

Comment on lines 17 to 39
switch (operation) {
case "a":
key = scan.nextInt();
value = scan.nextInt();
map.addValue(key,value);
break;

case "b":
key = scan.nextInt();
map.findKey(key);
break;

case "c":
map.getSize();
break;

case "d":
key = scan.nextInt();
map.removeElement(key);
break;

case "e":
map.printElements();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract to a new method and also handle when user enter the f
aslo what if user entered a letter that doesn't exist

Comment on lines 17 to 27
switch (operation) {
case "a":
key = scan.nextInt();
value = scan.nextInt();
map.addValue(key,value);
break;

case "b":
key = scan.nextInt();
map.findKey(key);
break;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract to a new method

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same comments in other tasks

Comment on lines 24 to 25
public void addWord(char key,String word){
word_dectionary.get(key).add(word);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it add the word automatically to its coressponding key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants