A switch statement , Computer Engineering

Which is more efficient, a switch statement or an if else chain?

Ans) The differences, if any, are likely to be small. The switch statement was designed to be efficiently implementable, though the compiler may want to use the equal of an if/else chain (as opposed to a compact jump table) if the case labels are sparsely distributed.

 

 

Posted Date: 4/8/2013 3:12:34 AM | Location : United States







Related Discussions:- A switch statement , Assignment Help, Ask Question on A switch statement , Get Answer, Expert's Help, A switch statement Discussions

Write discussion on A switch statement
Your posts are moderated
Related Questions
Q. How to Set Table Properties in dreamweaver? Now you will use table Property inspector to clear the extra space in navigation buttons table and to add a background color in t


What are the characteristics of the E-Cash? These kinds of payments, turning the Internet within a transaction oriented forum, need mediums which are easy and cheap (through a

Q. What is multi-threaded unix kernel? Multi-threaded UNIX kernel: We know threads are light-weight processors demanding minimal state information comprising the processor stat

in building a suspension bridge a cable is to be stretched from the top of a pier to a point 852.6 ft. from it''s foot. if from this point the angle of elevation of the top of the


What is the Scope of public/private/friend/protected/protected friend?    Scope of public/private/friend/protected/protected friend. Visual Basic/Visual C# Public/pub

Performance and Issues in Pipelining Efficiency:  The efficiency of a pipeline can be calculated as the ratio of busy time span to the entire time span including the idle time

Explain Disadvantage of Optimal Page Replacement Algorithm Optimal page replacement algorithm cannot be implemented in the general purpose operating system as it is impossible

Q. Main strength of ASCII? One such standard code which enables language encoding that is popularly used is ASCII (American Standard Code for Information Interchange). This cod