Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparing Algorithm #2

Open
jcpwfloi opened this issue Jan 30, 2014 · 1 comment
Open

Comparing Algorithm #2

jcpwfloi opened this issue Jan 30, 2014 · 1 comment

Comments

@jcpwfloi
Copy link
Contributor

Due to the need of the program, we'll just have to compare the lines.

The algorithm have three steps:

First, read the history_version file and build a map, the map is a map of string to int. The string represents the md5 of the line and the int is the line number (row number).

Then, read the current_version and read the rows, if it has appeared in the history_version, give it a line number. Due to the problem of "duplicate lines", we'll just have to do the second step synced with the first step.

We'll have to build an LIS array, so we'll just have to choose the line number that can generate the maximum LIS, if several numbers simultaneously meet the requirement, we'll just have to select the minimum one(Greedy algorithm).

Second, that is the LIS, don't forget to let the program simultaneously record the path of the LIS.

Third, just can the current_version and output modify out of LIS path.

I'll give a segmentTree interface in the file folder core/algorithm/segmentTree.

@ghost ghost assigned zhijian-liu Jan 30, 2014
@jcpwfloi
Copy link
Contributor Author

jcpwfloi commented Feb 1, 2014

okay, the SAM algorithm is preferred. But @dilutedream please give me the interface information=-= thx.

@jcpwfloi jcpwfloi closed this as completed Feb 1, 2014
@jcpwfloi jcpwfloi reopened this Feb 2, 2014
@zhijian-liu zhijian-liu removed their assignment Feb 18, 2018
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

No branches or pull requests

2 participants