This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Common or well-known algorithms?

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello! I am relatively new to Java (and love it!). I'm discovering that 'coding' is actually the easy part. Figuring out how to solve a particular problem is the 'thinking' part. Are there books or web-sites (I prefer free) of common or well-known algorithms and the problem they solve? For example, evaluating a leap year seems to be a popular one that is learned quickly when learning a new language. I'm sure there are others... how can I find them?
Thanks!
David Crossett
 
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java almanac is a good place to find things you would commonly do in code.
http://javaalmanac.com/
These are useful however, if you are looking for even more generic solutions I recommend the Martin Fowler book on refactoring and the Gang of 4 Design patterns books. The amazon links for each follow and both are well worth the money:
1) refactoring - http://www.amazon.com/exec/obidos/tg/detail/-/0201485672/qid=1066964048/sr=1-6/ref=sr_1_6/102-4756292-7424125?v=glance&s=books
2) design patterns - http://www.amazon.com/exec/obidos/tg/detail/-/0201633612/qid=1066964106/sr=1-1/ref=sr_1_1/102-4756292-7424125?v=glance&s=books
 
lowercase baba
Posts: 12893
63
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used a book called "introduction to algorithms" in college. it give very generic solution to LOTS of common problems - from sorting to traversing to everything.
http://www.amazon.com/exec/obidos/tg/detail/-/0262032937/qid=1067363073/sr=8-1/ref=sr_8_1/103-1044406-3503848?v=glance&n=507846
expensive, and VERY high level math stuff, but i still go back and re-read it every so often.
It talks a lot about analyzing your data before trying to come up with "THE SOLUTION". example: i had a problem at work where it was taking a program DAYS to do something.
i found it was using a Quicksort algorithm, on a HUGE file that was already sorted. Guess what? that's a bad idea. so i wrote a bubble sort (which is usually considered quite bad), and reduced performance time from 3 days to 2 hours.
 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic