Skip to content

An implementation for two sum Algorithm using hash table and multi-threading

Notifications You must be signed in to change notification settings

Abdallah-Elshamy/2-sum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

2-sum

An implementation for two sum Algorithm using hash table and multi-threading

The file "2sum.txt" contains 1 million integers, both positive and negative (there might be some repetitions!).This is your array of integers, with the ithi^{th}ith row of the file specifying the ithi^{th}ith entry of the array.

Your task is to compute the number of target values ttt in the interval [-10000,10000] (inclusive) such that there are distinct numbers x,yx,yx,y in the input file that satisfy x+y=tx+y=tx+y=t. (NOTE: ensuring distinctness requires a one-line addition to the algorithm from lecture.)

Write your numeric answer (an integer between 0 and 20001) in the space provided.

About

An implementation for two sum Algorithm using hash table and multi-threading

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages