1. Summary of this week's study
1.1 Summarize the set and generic related content in the way you like (mind mapping or other).
1.2 Choose: Collect code snippets that you think are useful
2. Written work of this job title set
集合
1. Deletion of the specified element in the list (title of the topic)
1.1 Experimental summary. and answer: List at least 2 ways to delete elements in the list.
A: Create a list,add INPUT element to list.get(i).equals(str) determine if you want to delete an element, and note that the order in which the element is deleted needs to start from the back, and if a few elements are omitted from the beginning because of the I change.
To delete the elements in the list:
(1) The first method is its own use, starting from the back to traverse, so that I value will not be affected
(2) The second method of deletion is to use an iterator to delete the operation.
2. Count the number of words in the text and sort them by the number of occurrences (problem set)
2.1 pseudocode (Do not copy code, otherwise deduct)
For:
This requires creating a TreeMap object, adding elements to "!!!!!" End
Use split split for each line of elements;
Determine if the word is present in the word map, there is no add, value is added one, and if it does not exist, the value is one;
Use Collection.sort to sort the list;
Finally output key and value;
2.2 Experimental Summary
The process of adding elements;
Establish internal classes, compare;
3. Inverted index (problem set)
The subject is more difficult, do not come out does not matter. But must have own thinking process, must have the submission result.
3.1 Your code runs the result
3.2 pseudocode (Do not copy code, otherwise deduct)
1. Create map object map and ArrayList object line
2. Loop through the word and read the word "!!!!!" , exit the loop, otherwise judge if the map does not contain the word, add the word to map and add the corresponding row value to value, if the current number of rows does not exist in value, then add the current number of rows to value.
3. Create an iterator, output all the contents of the map, enter a row of query keywords, separated by a space.
4. Determine if there is a specified word in the map, and the output found 0 results is not present.
Otherwise, the intersection of the value of the specified word is obtained, if the intersection is 0, the output found 0 results, otherwise the output intersection and the number of the intersection of the number of rows.
3.3 Experimental Summary
Answer: The main idea of the pseudo-code of this problem is to rely on a big guy in the dorm to explain, through his explanation about the idea of the problem, and then try to write their own code, but there are several important steps to search the compilation error, some features did not realize so can only refer to the big guy's code.
4.Stream and Lambda
Write a student class that has the following properties:
private Long id; private String name; private int age; private Gender gender;//枚举类型 private boolean joinsACM; //是否参加过ACM比赛
Creates a collection object, such as a list
4.1 Use the traditional method to write a search method List<Student> search(Long id, String name, int age, Gender gender, boolean joinsACM) , and then call the method will id> a value, name is a value, age> a value, gender to a value, the students who participated in the ACM contest to filter out, put into the new collection. Called in Main, and then outputs the result. (: The number of the school, name)
Search process
Main function implementation
4.2 Use the stream () in Java8, filter (), collect () to write the code with the same 4.1, and test (to show the test data). When building a test collection, in addition to the normal student object, add some null to the collection, and the method you write should handle the null instead of throwing an exception. (: The school number appears)
5. Generic type: Generalstack
jmu-Java-05-集合the Generalstack of the title set
5.1 Code for Generalstack interface
5.2 ArrayListIntegerStack What are the benefits of generics compared to previous assignments?
A: In Arraylistintegerstack, the elements in the stack can only be of type Integer, have limitations, and use generics to write code, can be used by different types of objects, can not use coercion type conversion, and errors can be found in the compilation phase.
6. Select: Generic method
The base reference file is Genericmain and is modified on this file.
6.1 Write Method Max, which returns the maximum value of all elements in the list. The elements in the list must implement the comparable interface. The Max method is written so String max = max(strList) that it can run successfully, where strlist is the List<String> type. can also make Integer maxInt = max(intList); the operation successful, where Intlist is the List<Integer> type. Note: You must not call the Collections.max function directly.
6.2
Optional: The existing user class, whose subclasses are Stuuser, and all implement the comparable interface. Writing method Max1, basic ability with 6.1, make user user = Max1 (stulist), can run successfully, where stulist is List
Choose: Write int myCompare(T o1, T o2, Comparator c) method, the method can compare two user objects, you can also compare two Stuuser objects, the incoming comparator c can be Comparator<User> , or can be Comparator<StuUser> . Note: This method declaration is not fully written, please complete it yourself.
7. Select: Inverse maximum matching segmentation algorithm
Set the No. 07 Experiment (Collection) in the experiment file. doc file, inside the topic 6.
7.1 Write pseudo-code (not directly copied code)
7.2 Your code runs the result.
3. Code Cloud and PTA
Topic Set:jmu-Java-05-集合
3.1. Code Cloud codes Submission record
- In the Code cloud Project, select statistics-commits history-set time period, and then search for and
3.2 PTA Problem set complete situation diagram
Two graphs are required (1. Ranking chart. 2.PTA Submission list diagram)
3.3 Count the amount of code completed this week
The weekly code statistics need to be fused into a single table.
Can you achieve your goals?
| weekly | Total code Volume | New Code Volume | Total Files | new file number |
|--------|------|-------|------|-------|
|1|44|44|2|2|
|2|213|213|10|5|
|3|417|204|10|5|
|5|676|259|17|7|
|6|1071|405|24|7|
|7|1780|709|30|6|
|8| 1900|120|35|5|
|9|2335|435|41|6|
|10|2767|432|48|7|
4. Assess how much you understand Java
Try to evaluate how much you understand Java from the following dimensions
| Dimension of |
degree |
| Grammar |
PTA Topic has been able to easily take care of, there is nothing difficult to pour my grammar problems |
| Object-oriented design capabilities |
Can skillfully use object-oriented thinking to model the problem to be solved |
| Application capabilities |
You can use Java to write some useful gadgets |
| Number of lines of code so far |
5000 |
Optional: 5. Use Java to solve real-world problems
There are n courses where each student has a few questions about each course (each subject has a label). Teachers expect to classify the problems of all students, first classifying the problems by course, and classifying the same student's topic in some category. The existing operation process is that each student does not know the subject in his own subjects according to the course classification number after the issue to the Study Committee members to study the unified summary. It is now hoped that a program will be developed to help students categorize and to count which topics in each course do not understand the highest rate. Trying to write out the approximate steps to solve the problem? The contents of each student's document should follow a certain standard to facilitate the process, try to write the specification.
201621123042 Java Programming Nineth operations