Saturday 15 August 2015

java - Optimally fit different sized cards on a paper (from interview) -



java - Optimally fit different sized cards on a paper (from interview) -

i saw interesting interview question on glassdoor, couldn't find solution.

lets assume have paper in size of 8" 11". how go designing algorithm optimally fit smaller cards onto paper.

now don't have actual card dimensions illustration lets assume smaller cards 3" 4", 7" 2" , 5" 3".

i understand packing problem, wanted know how utilize dynamic programming faster solution brute forcefulness , handle rotation @ same time.

you think of these next algorithms have time complexity o(n log n) :

first-fit decreasing height (ffdh) algorithm next-fit decreasing height (nfdh) algorithm hybrid first-fit (hff) hybrid next-fit (hnf)

java c++ dynamic-programming

No comments:

Post a Comment