1E

Real-world examples of sorting:

• Arranging the books in a library according to the alphabetically order of author’s name mesh is an example of sorting.

• Arranging the icons on the desktop according to name, size, or type of the application is an example of sorting.

• Arranging the mails by date in web mail service is an example of sorting.


Real-world examples of convex hull:

• Constructing a fence around the boundary of a garden using iron mesh is an example of convex hull.

• The concept of convex hulls is used in GPS devices and in image detection.

2E

Following are the measures of efficiency other than speed in the real world:

1. Space : How much amount of space it requires?

2. Simplicity : Is it easy to understand or do?

3. Correctness : Is the solution correct?

4. Economy : How much it costs?

5. Reliability : Is it consistently good in quality or performance?

6. Compatibility : How compatible is it with other systems?

7. Robustness : Is the system robust?

3E

An array is a variable that holds multiple values of the same data type.

Strengths of array:

1. Multiple data items of same type can be referred by using a single name.

2. The elements of an array can be accessed directly by index.

3. Arrays can be used to implement other data structures like linked lists, stacks, queues, trees, graphs etc.

4. Iterating through an array has a good locality of reference.

5. Arrays can be used to represent multi-dimensional data like matrices and tables.


Limitations of array:

1. Array is a static data structure. Memory is allocated at compile time and cannot be changed during run time.

2. It is difficult to insert elements into an array or delete elements from an array.

3. Memory is wasted in the case when a large size array is declared and uses only few locations.

4. Array cannot grow or shrink dynamically.

4E

The Shortest path problem:

The shortest path problem in graph theory is the problem to find a path between two nodes (or vertices) in the given graph such that the sum of its constituent’s edges weights is minimized.

The travelling-salesman problem (TSP):

The TSP (Travelling Salesman problem) is defined as an NP-hard problem in combinatorial optimization studied in theoretical computer science and operations research.

In TSP, the main task is to find a shortest possible path which visits each nodes or vertices exactly once and return the starting node.


The travelling salesman and shortest path problem are similar in the following manner:

• Both the travelling salesman and shortest path problem are minimization problems.

• Both the problems will minimize the overall distance travelled.

• The travelling salesman and shortest path problem traverses a graph to find the path.


The travelling salesman and shortest path problem are different in the following manner:

• In shortest path problem, there just need to minimize the distance between the two nodes or vertices. There is no matter of routes that exist between them.

• But in the travelling salesman problem, it requires a path between multiple points (or nodes) that returns to the first point (or node).

5E

There are many more real world problems where best solution is required. An approximate solution is not acceptable in these cases because it may cause a loss of life or too much money. Some of real world problems are as follow:

Medical science: The instrument uses in medical science must provide the exact information. When the output of the machine (like cardiograph machine) is not accurate then it may possible the patient will not get the proper treatment.

Costly research: Suppose researcher tries to found out the trajectory of a satellite, then in that case they want the best solution. It is because satellite launching is very expensive and if anything goes wrong then the whole project get fall down.

There are also many situations where an approximate solution is also acceptable. Here approximate solution does not lead to loss of life or too much money.

• Suppose a person has to find a shortest path between two cities. In that case best solution is not required because if he does not succeed to find the shortest then still he reach the destination.

• An approximate solution is also acceptable in weather forecasting. A weather forecasting includes lots of approximation and analyses of previous data.

Chegg Rip, Introduction to Algorithms, 3rd Edition. [RipVer 0.1] (index)