|
Site Visited 503629 times | Page Visited 20 times | You are in : Etantonio/EN/Universita/1anno/FondamentiInformatica/Pascal/ |
Algorithms of ordering and search Algorithms of search 1) What is the meaning for dicotomica search of an element in a tidy carrier: It is a type of search that demands an ordered carrier, itera it sin when the inferior end of the carrier is greater of the advanced end, the step of the iterance is instead the modernization of one of the 2 ends on the base of the value of intermediate element M, if M are greater of the searched value then M-1 become the new advanced end, otherwise if M is smaller of the searched element then M 1 becomes the new inferior end. Algorithms of ordering
2) Describe the algorithm of ordering of a carrier for selection (SELECTIONSORT): Itera from 1° the element of the carrier until to the last one, and the iterativo step consists in the substitution of the element in issue with an other element of the carrier that is smaller.
3) Describe the algorithm of ordering to bubbles of a carrier (BUBBLESORT): Are necessary (n_elementi - 1) steps rerun to you in everyone of which scandisce the remaining carrier making exchanges between adjacent cells so as to to carry towards the high the smaller element. To the term the tidy carrier is obtained.
4) Describe the algorithm of ordering of a carrier for fusion (MERGESORT): One divides to the carrier in containing segments groups of data orders to you in increasing way and these segments are shunted alternatively on 2 supports of memorizzazione(Files or Vettori) after which efettua the fusion of the values contained in the 2 brace supports of 2 segments to the time. Executing more times this step obtains the tidy carrier.
5) Describe the algorithm of fast ordering of a carrier (QUICKSORT): An element pertaining to the Array chooses itself and it divides to the Array in 2 parts, containing inferior elements to pivot and an other containing part the advanced elements to the pivot after which the same ordering is executed on everyone of the 2 sottosets created sin when the tidy carrier is not obtained. 6) Algorithm for the writing of an algorithm;to) an idea clear of what Is made it is the problem, analyzing it before completely and then coming down in the detail. b) To write the algorithm in natural language, such description will become the comment of the algorithm c) To replace to the natural language of the procedures or laddove possible of the Pascal instructions d) For every procedure to return to point 2 |