In addition to what others have mentioned, here are some example resources you might prefer for a beginner-intermediate level intro:
1. (free online) Algorithms by Dasgupta, Papadimitriou, and Vazirani http://algorithmics.lsi.upc.edu/docs/Dasgupta-Papadimitriou-...
2. (free online) Algorithms by Jeff Erickson https://jeffe.cs.illinois.edu/teaching/algorithms/
3. Algorithm design by Kleinberg & Tardos https://www.amazon.com/Algorithm-Design-Jon-Kleinberg/dp/032...
4. Another one specifically for more applied view (esp., how they are used in programming contests such as ICPC) is Skiena & Revilla's "Programming Challenges" book (https://www.amazon.com/Programming-Challenges-Contest-Traini...). Note that this is different than Skiena's other popular book (Algorithm Design manual) which is also pretty good and has a "war story" based perspective to design of algorithms.
5. There are also several resources where lecture notes from university Algorithm & DS courses are very useful. Here is an example from my previous Professor, David Kempe: http://david-kempe.com/teaching/DataStructures.pdf
6. Several programming competition specific tutorials can be found on Topcoder: https://www.topcoder.com/thrive/tracks?track=Competitive%20P... (individual SRM archives are also good place to try problems first hand and then learn from other's approach). In general, if you search for ACM-ICPC resources, you will find a lot more targeted information/problems which will apply not only for leetcode, but also for detailed understanding of the theory too.
http://www.amazon.com/Algorithm-Design-Jon-Kleinberg/dp/0321...
http://www.amazon.com/Algorithm-Design-Jon-Kleinberg/dp/0321...
http://www.amazon.com/Introduction-Algorithms-Third-Thomas-C...
Algorithm Design
by Jon Kleinberg & Éva Tardos
ISBN: 978-0-321-29535-8
Or an Amazon link: http://www.amazon.com/Algorithm-Design-Jon-Kleinberg/dp/0321...
Its a good introduction, but it will require you to be decent at math and know how to do proofs.
On the other hand, if you are interested in how programs can express things, then maybe you want to learn about some CS theory. Specifically, some lambda calculus would be good to learn, but I don't have any good suggestions.
Note: All of these will be easier to read if you are pretty good at programming, so I'd say follow at least the first piece of advise above.
It is a really enjoyable read and has a nice narrative that I think other algorithm books are lacking. CLR, for instance, just reads like a handbook to me. The goal Kleinberg/Tardos book, OTOH, is to teach you how to design and analyze algorithms. They will actually follow false starts on certain problems and uncover where they break.
Kleinberg is the rebel king!
http://www.amazon.com/Introduction-Algorithms-Thomas-H-Corme...
Good advanced text: Jon Kleinberg/Eva Tardos: Algorithm Design
http://www.amazon.com/Algorithm-Design-Jon-Kleinberg/dp/0321...
But if you really want to learn more about algorithms, check out this book:
http://www.amazon.com/Algorithm-Design-Jon-Kleinberg/dp/0321...
As for programming languages, the java + eclipse combination is excellent.