java - Which data structure should I use to search a string from CSV? -
I have a CSV file that contains some 200,000 rows, two column names and names; work. The user then writes a name, user_a says, and i have to search the whole csv to find names that are pattern user_nA and finally print on the output screen. I implemented it using Java in Araliaist, where I put the full name from the CSV to Arreist and then searched for the pattern in it. But in that case, the complexity of the whole time for search is (N), is there any other data controller in Java that I can use to make it more efficient than O (Logan) or AreliIst? I can not use any database approach from the way. Apart from this, if there is any good data structure in any other language that I can use to accomplish my goal, please give me this suggestion?
Edit - The output should be named in the CSV in which the pattern user_name example as the previous part: If my input is "son" then it should return "jackson" etc. Now what I have done, a string called the name of the CSV is read out by the name of CSV, then every element is read using ArrayList and regular expression (Pattern of Java - Maitre) to see that in the element The name of the user is in the form of the last part. If yes, then print it if I implement it in a multi-threaded environment, will it increase the scalability and performance of my program?
You can use:
-
TreeMap < / Code>, this red-black tree is solved,
Comments
Post a Comment