tag:blogger.com,1999:blog-6114569110436058817.post8647408327996817115..comments2024-03-09T06:43:57.529+01:00Comments on litb's Blog: Fun with switch statementsJohannes (litb)http://www.blogger.com/profile/07110437420755294372noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-6114569110436058817.post-84033081599584162292022-03-03T19:08:05.459+01:002022-03-03T19:08:05.459+01:00Harrah's Cherokee Casino & Hotel - Mandara...Harrah's Cherokee Casino & Hotel - Mandara<br />Information and Reviews about Harrah's Cherokee Casino & Hotel in Mandara, including <a href="https://drmcd.com/%ed%83%9c%eb%b0%b1%ea%b0%80%ec%9e%a5-%ec%9d%b8%ea%b8%b0-%ec%9e%88%eb%8a%94%ec%b6%9c%ec%9e%a5%ec%83%b5%ea%b0%80%ea%b2%8c.html/" rel="nofollow">태백 출장안마</a> Rooms, Phone number, Address, Website, Phone number, Website, <a href="https://www.jtmhub.com/%ec%8b%9c%ed%9d%a5%ec%97%90-%eb%8c%80%ed%95%9c-%ec%9a%b0%ec%88%98%ed%95%9c%ec%b6%9c%ec%9e%a5%eb%a7%88%ec%82%ac%ec%a7%80%eb%a6%ac%eb%b7%b0.html/" rel="nofollow">시흥 출장마사지</a> Address, Website, Rating: 4.6 · <a href="https://drmcd.com/%eb%b6%80%ec%82%b0%ea%b4%91%ec%97%ad%ec%b5%9c%eb%8c%80%ea%b7%9c%eb%aa%a8%ec%b6%9c%ec%9e%a5%eb%a7%88%ec%82%ac%ec%a7%80.html/" rel="nofollow">부산광역 출장마사지</a> 21 <a href="https://www.jtmhub.com/%ec%95%88%ec%82%b0%ec%97%90-%eb%8c%80%ed%95%9c-%ec%9a%b0%ec%88%98%ed%95%9c%ec%b6%9c%ec%9e%a5%eb%a7%88%ec%82%ac%ec%a7%80%eb%a6%ac%eb%b7%b0.html/" rel="nofollow">안산 출장안마</a> reviews <a href="https://www.jtmhub.com/%eb%b0%80%ec%96%91%ec%a3%bc%eb%b3%80-%ea%b0%80%ea%b9%8c%ec%9a%b4%ec%b6%9c%ec%9e%a5%ec%95%88%eb%a7%88.html/" rel="nofollow">밀양 출장샵</a>raisabistonhttps://www.blogger.com/profile/04334086387871183528noreply@blogger.comtag:blogger.com,1999:blog-6114569110436058817.post-22482548143667787672013-03-29T16:42:09.466+01:002013-03-29T16:42:09.466+01:00You may take a look at my solutions at http://prog...You may take a look at my solutions at <a href="http://programming.sirrida.de/programming.html#c_case_of_string" rel="nofollow">http://programming.sirrida.de/programming.html#c_case_of_string</a>.<br /><br />The fastest presented solution is case_map.c which uses an optimized (not necessarily perfect) hash container created at run time the first time the switch is used.<br />It even runs under plain C. C++ is not needed.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6114569110436058817.post-60262229974230789882012-12-30T18:14:07.621+01:002012-12-30T18:14:07.621+01:00A compiler is always able to produce a jump table,...A compiler is always able to produce a jump table, regardless of the complexity of the formula.<br /><br />Switching to another asymptotically worse method for small values doesn't change the fact that it is O(1), since the bound is a constant.Mathias Gaunardhttps://www.blogger.com/profile/05052622266785164907noreply@blogger.comtag:blogger.com,1999:blog-6114569110436058817.post-85126392669856758972012-12-30T17:41:24.814+01:002012-12-30T17:41:24.814+01:00@Mathias Gaunard
switch is not O(1) in the genera...@Mathias Gaunard<br /><br />switch is not O(1) in the general case. If the compiler can generate a simple formula and build a jump table, it is. But more often than people think, the compiler will generate a dichotomic search in a table containing the case values.<br />For small number of cases it will even generate the same code as an if/else cascade.<br />The choice of algo depends on the compiler, the destination machine and the case values.gallier2https://www.blogger.com/profile/04285836062429366578noreply@blogger.comtag:blogger.com,1999:blog-6114569110436058817.post-56947791497528821102011-07-28T21:34:58.199+02:002011-07-28T21:34:58.199+02:00@Srinivasa: Read his email address again. You miss...@Srinivasa: Read his email address again. You missed out a character.tomalakhttps://www.blogger.com/profile/07010495421893581198noreply@blogger.comtag:blogger.com,1999:blog-6114569110436058817.post-51480889983120265992011-07-24T12:36:04.014+02:002011-07-24T12:36:04.014+02:00The point of switch is that it is O(1). Your solut...The point of switch is that it is O(1). Your solution is O(n), and is therefore not a good idea.<br /><br />I guess maybe you could do something interesting using hashing and lambdas.Mathias Gaunardhttps://www.blogger.com/profile/05052622266785164907noreply@blogger.comtag:blogger.com,1999:blog-6114569110436058817.post-25254009286219389362011-07-14T20:13:45.570+02:002011-07-14T20:13:45.570+02:00Hi,
I am trying to reach you. Can you kind...Hi, <br /><br /> I am trying to reach you. Can you kindly give me your email address. You can reach me at savinirs.varadan@gmail.com. I tried using itb@jabber.org but that dosent seem to work. <br /><br />Thanks, <br />Srinivasa Varadan.Savinirs.https://www.blogger.com/profile/00442995185617181594noreply@blogger.comtag:blogger.com,1999:blog-6114569110436058817.post-35836550298568326112010-11-27T04:43:40.570+01:002010-11-27T04:43:40.570+01:00Ich sehe keine offensichtlichen Probleme. Gute Ide...Ich sehe keine offensichtlichen Probleme. Gute Idee. Ich denke nicht, ich würde es in der Produktion Code verwenden, es ist ein bisschen wie ein Hack:-DJames McNellishttps://www.blogger.com/profile/10237279862678266837noreply@blogger.com