15,390,899 members
Home / Discussions / Algorithms

# Algorithms

 problem in Theta-θ Notation Arjun Tirumalasetty25-May-15 2:21 Arjun Tirumalasetty 25-May-15 2:21
 Geometry domain problem in Competitive algorithm Chaitanya Pai23-May-15 1:34 Chaitanya Pai 23-May-15 1:34
 Re: Geometry domain problem in Competitive algorithm Richard MacCutchan23-May-15 2:09 Richard MacCutchan 23-May-15 2:09
 Base 36 value math problem stoneyowl25-May-15 7:41 stoneyowl2 5-May-15 7:41
 Re: Base 36 value math problem Matt T Heffron5-May-15 8:12 Matt T Heffron 5-May-15 8:12
 Re: Base 36 value math problem stoneyowl25-May-15 9:33 stoneyowl2 5-May-15 9:33
 Re: Base 36 value math problem Matt T Heffron6-May-15 7:49 Matt T Heffron 6-May-15 7:49
 Re: Base 36 value math problem Daniel Pfeffer6-May-15 21:21 Daniel Pfeffer 6-May-15 21:21
 You can implement this with a form of binary search. [Preparation] Sort the strings representing the first ticket in each book in ascending order: a. zero-pad any short strings (e.g. "ABC1" should be padded to "00ABC1" b. sort the strings using a case-insensitive sort c. pad the list with a dummy ending value (e.g. "ZZZZZZ"). d. pad the list with a dummy starting value (e.g. "000000").[Eliminate low values] Use a binary search to find the location of largest value less than or equal to the target string. If the result points to the starting dummy value, then no such value exists.[Eliminate high values] Use a binary search to find the location of the smallest value larger than the target string. If the result points to the ending dummy value, then no such value exists. The range [low, high) contains your result. If low != high, the range should contain a single element that is the desired ticket book. If low == high, no ticket book was found. Note that you can handle missing books in the sequence by adding dummy book starting values to the array. If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill
 Re: Base 36 value math problem Gerry Schmitz5-May-15 9:53 Gerry Schmitz 5-May-15 9:53
 Re: Base 36 value math problem stoneyowl25-May-15 9:58 stoneyowl2 5-May-15 9:58
 Re: Base 36 value math problem Gerry Schmitz5-May-15 10:15 Gerry Schmitz 5-May-15 10:15
 Re: Base 36 value math problem Patrice T17-Jun-15 19:00 Patrice T 17-Jun-15 19:00
 Re: Base 36 value math problem Frankie-C6-May-15 7:01 Frankie-C 6-May-15 7:01
 Re: Base 36 value math problem Matt T Heffron6-May-15 7:41 Matt T Heffron 6-May-15 7:41
 Re: Base 36 value math problem Frankie-C7-May-15 2:07 Frankie-C 7-May-15 2:07
 Re: Base 36 value math problem Patrice T17-Jun-15 18:37 Patrice T 17-Jun-15 18:37
 Re: how does C4.5 work? PIEBALDconsult25-Apr-15 7:46 PIEBALDconsult 25-Apr-15 7:46
 Re: how does C4.5 work? pt140125-Apr-15 8:39 pt1401 25-Apr-15 8:39
 Re: how does C4.5 work? Richard MacCutchan25-Apr-15 20:54 Richard MacCutchan 25-Apr-15 20:54
 Re: how does C4.5 work? Kornfeld Eliyahu Peter25-Apr-15 21:01 Kornfeld Eliyahu Peter 25-Apr-15 21:01
 Re: algorithm Sascha Lefèvre25-Apr-15 7:37 Sascha Lefèvre 25-Apr-15 7:37
 algorithm Deepak Pundir17-Apr-15 9:10 Deepak Pundir 17-Apr-15 9:10
 Re: algorithm Sascha Lefèvre17-Apr-15 9:48 Sascha Lefèvre 17-Apr-15 9:48
 Re: algorithm harold aptroot17-Apr-15 9:54 harold aptroot 17-Apr-15 9:54
 Re: algorithm PIEBALDconsult15-May-15 14:42 PIEBALDconsult 15-May-15 14:42
 Last Visit: 31-Dec-99 18:00     Last Update: 9-Aug-22 12:10 Refresh ᐊ Prev1...44454647484950515253 Next ᐅ