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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • 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?
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.
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 -
2) design patterns -
lowercase baba
Posts: 12893
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.
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
    Bookmark Topic Watch Topic
  • New Topic