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
Massively Parallel System Refers to a parallel computer system having a great number of processors. The number in a great number of keeps increasing and currently it means more

Explain the term middleware in context of RPC. A variety of commercial tools have been urbanized to assist the programmer in constructing client- server software. These tools a

What are the advantages and disadvantages of packet switching over circuit switching? The comparison of packet switching and circuit switching demonstrating advantages and disa

When using aspx view engine, to have a steady look and feel, across all pages of the application, we can build use of asp.net master pages. What is asp.net master pages equal, when

Some of the plug-ins have proven unstable. These have been moved into a split download, which should be available anywhere you got the GIMP, in the file gimp-plugins-unstable-VERSI

Q. What is Data link layer? Data link layer: data link layer is responsible for transmitting a group of bits between adjacent nodes. Group of bits is termed as frame. Network

TCP and UDP are both transport-level protocols. TCP is designed to give reliable statement across a variety of reliable and unreliable networks and internets. UDP gives a conne

What is data hazard in pipelining? What are the solutions? A data hazard is a situation in which  the pipeline is stalled due to the data to be operated on are delayed for some

A certain car has suspension modes which are uncoupled front to back.  When a person with a mass of 60 kg sits in the rear of a car, in the centre of the seat which is directly ove

JMX is native to the Java programming language. As a result, it offers natural, efficient, and lightweight management extensions to Java-based functions. It has of a set of specifi