captain_haddock
BAN USER
Comments (3)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
also check timezone loading issues
- captain_haddock February 04, 2014Comment hidden because of low score. Click to expand.
0
of 0 vote
Represent the Strings as char[], scan the first string once, to count the number of times that char c is present, now calculate the length of the final string, and fill it from backwards O(2n) = O(n)
Example: abcdcdef and xyz are 2 strings, represent them as a char[], given char c, now scan first string, we find c twice, so the final string length is 8 - 1 + 3 - 1 + 3 = 12, create a new char[] and fill it from backwards with the first string, but when u hit c, fill it with the second string xyz instead of the c.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Do we use a combination of Dijkstras and Minimum Spanning Tree using Prims?, use Minimum Spanning Tree to go through all the nodes once, after that use Dijkstras to come back to the start node from the end node?, this might not be the best shortest path around, but an approximation of shortest path around.
- captain_haddock February 07, 2014