Danmc's Posts
Nairaland Forum › Danmc's Profile › Danmc's Posts
1 (of 1 pages)
It is well known that Cyrus is the one who conquered Babylon but it is believed that he let his half-countryman Darius the Mede take the seat. But Darius soon died (approx. 1 year) and Cyrus himself took over. |
WhiZTiM: The algorithm can be implemented recursively to further beat down the SLoC by a meagre factor...i removed it like u said and now it works well. just to quote linus torvalds: "talk is cheap. show me the code", pls implement what u just said. i'd love to see it. |
WhiZTiM: Here is a closely coupled working program that solves authurowens problem.tanx boss for the proggie but it still isn't perfect yet. try inputting a 3x3 matrix e.g. "1 2 3", "4 5 6" and "7 8 9". the output misses the last item in the spiral i.e. "5"! pls fix it ![]() |
WhiZTiM: HERE is my OPTIMAL CODE in C++: Its currently the FASTEST implementation I reasoned...man, u can't just copy and paste some portion of ur code and tell us to feed it with blah blah blah. it compiled fine but couldn't run it. crash!!! i beg check ur algo well and pls show us a working proggie. |
WhiZTiM: Here is my code in python, well commented; and with very good explanation for easy comprehension....your code works well but is highly insecure and wasteful. reasons: 1. when proggie asks for input, enter "1 2" and "3" the second time. boom, index out of range!!! 2. when proggie asks for input, just hit enter. boom, proggie asks for input infinitely!!! 3. proggie allocates memory 3x for this simple algo: array, state_grid and rtn. boom, why oh why!!! |
lordZOUGA: no problem, after tonight's match.hmmm.. ok will be waiting. good luck 9ja ![]() |
jacob05:he's saying make it dynamic so that it can handle any number of items in the matrix. what u have so far is static. anyway, it's good that u tried. |
lordZOUGA: this is trivial. you just have print a 2 dimensional data structure in a different way.are you sure sir? i tried attempting it but couldn't do it. if it's trivia show us a solution (no offense) |
1 (of 1 pages)
....
You can add as much array to the list bro. An example to explain what you mean pls?