Standard DS and Algo

Is there any site where we can find standard Algorithms questions with big test cases. Geeks for Geeks generally have all algos, but suppose someone wants to test on big test cases. Usually when I learn new topic I try some questions on HackerEarth (It has section wise questions) but they are also not completely standard.

Try a2oj.com It contains links to problems from other sites for a variety of topics. Basically you can select a category/topic and see 100s of problems of it.

1 Like

Suppose today I learnt today Knapsack Problem from Geeks For Geeks and what If I want to test it for larger cases.

Not sure about a particular problem like Knapsack but at a2oj you can find problems category-wise say for example DP, Greedy or Graph.
For your case though I have a suggestion, if by large cases you mean a large number of cases where you want to check the correctness and timing of your algorithm you can do this. I usually try this in Long Challenges to compare my Brute Force approach with the optimal I have on the mind at the point.
Create a Python script to randomly generate large number of test cases for inputs to your program, use file redirection to save them in a text file. Now, keep both your Brute Force and Optimal Program ready and use file redirection to pass them inputs from the text file you save previously. Save outputs from both(Brute Force and Optimal) in separate files(you can use file redirection again). Now, for comparing correctness of your Optimal Program you can simply use the diff command of Linux and compare the output files from the two different program. The diff command splits the line numbers where the output in the two files differ. If for a large number of generated test cases the diff finds no difference between the two output files then you can be quite sure that your program is running correctly.
For checking timings you can use library functions to check the time elapsed between starting and termination of your program. Usually, OJs have a limit of 1 or 2secs for program execution.

2 Likes

Thanks Bro :grinning:

1 Like

Check CP algorithms http://cp-algorithms.com/ . Every standard algo is given here

2 Likes