1. Mention the objectives of structured programming.
a. To produce error free program.
b. To incorporate basic structured constructs.
c. To eliminate use of GOTO Statements.
d. To obtain a disciplined approach towards programming.
e. To improve the flexibility of a program.
2. Explain Binary search algorithm
This algorithm is used to search for an element in a sorted list. The value of the element in the middle of the list is compared with the value of the element to be searched for . If the middle element is larger, the desired element has to be in the upper of the list. If the middle element is smaller, the desired element has to be lower half of the list. The number of elements to be searched is reduced by half in every iteration.
0 Comments