Understanding of the data comparison

Problems encountered scenarios:

Page points AB 

A B returns into the first A need to save the data once again to save a page to enter the B data returned from page A B A page from here and just say save scene data

(And the number of B into A page from the page has a relationship) 

One is provided down two ideas for a double cycle that is Map <inter, String> 

Thinking 1.for first loop is the first loop and then up the data stored in the first list to a boolean used to record the circulation position because if not, then there will be two problems will 2. 1. Duplicate data reason 1 memory overflow problems if the selected data as two different lengths list two different 2. By contrast duplication of data occurs because of the problem 2 if you are directly newly selected data to the first once inside, then choose the latter if the judge so the place is filled with data after me twice for circulating memory overflow occurs  

2. Ideas 2

This then creates an empty set and the first map for the first loop to map inside the memory a list comparing the value of a stored key-value pair and the second cycle stored value of the first value of a second comparative I value the logic here is not only to load the same value is then added to the list for the first time will be able
to recommend the second efficiency is relatively small because the amount of data may be the first treatment for the two cycle loss performance and relatively large amount of data, then a problem can occur because the first anr are multiplied 

Published 15 original articles · won praise 0 · Views 5402

Guess you like

Origin blog.csdn.net/hc5054/article/details/102819060