$(function(){
$("#headerSearchForm").on("submit", function(event)
{
event.preventDefault();
var query = $.trim($("#headerSearchQ").val());if (query.length == 0) {return false;}
location.href = "https://buscador.rincondelvago.com/" + query.replace(/[^ a-záâàäéêèëíîìïóôòöúûùüçñA-ZÁÂÀÄÉÊÈËÍÎÌÏÓÔÒÖÚÛÙÜÇÑ0-9'"]/g,"").replace(/ /g,"+");
});
$("#bodySearchForm").on("submit", function(event)
{
event.preventDefault();
var query = $.trim($("#bodySearchQ").val());if (query.length == 0) {return false;}
location.href = "https://buscador.rincondelvago.com/" + query.replace(/[^ a-záâàäéêèëíîìïóôòöúûùüçñA-ZÁÂÀÄÉÊÈËÍÎÌÏÓÔÒÖÚÛÙÜÇÑ0-9'"]/g,"").replace(/ /g,"+");
});
});
var div_1_sizes = [
[320, 100],
[320, 50],
[300, 250],
[300, 600]
];
var div_2_sizes = [[970, 90], [728, 90],[970, 250]];
var PREBID_TIMEOUT = 2000;
var adUnits = [{
code: 'div-gpt-ad-1498674722723-0',
mediaTypes: {
banner: {
sizes: div_2_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485609'
}
}]
},{
code: 'div-gpt-ad-1515779430602-1',
mediaTypes: {
banner: {
sizes: div_2_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485931'
}
}]
},{
code: 'div-gpt-ad-1515779430602-2',
mediaTypes: {
banner: {
sizes: div_2_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485934'
}
}]
},{
code: 'div-gpt-ad-1515779430602--3',
mediaTypes: {
banner: {
sizes: div_2_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485937'
}
}]
},{
code: 'div-gpt-ad-1515779430602--4',
mediaTypes: {
banner: {
sizes: div_2_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485941'
}
}]
},{
code: 'div-gpt-ad-1515779430602--5',
mediaTypes: {
banner: {
sizes: div_2_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485945'
}
}]
},{
code: 'div-gpt-ad-1515779430602--6',
mediaTypes: {
banner: {
sizes: div_2_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485949'
}
}]
},{
code: 'div-gpt-ad-1515779430602--7',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485953'
}
}]
},{
code: 'div-gpt-ad-1515779430602--8',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485956'
}
}]
},{
code: 'div-gpt-ad-1515779430602--9',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485957'
}
}]
},{
code: 'div-gpt-ad-1515779430602--10',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485958'
}
}]
},{
code: 'div-gpt-ad-1515779430602--11',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485959'
}
}]
},{
code: 'div-gpt-ad-1515779430602--12',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485960'
}
}]
},{
code: 'div-gpt-ad-1515779430602--13',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485961'
}
}]
},{
code: 'div-gpt-ad-1515779430602--14',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485962'
}
}]
},{
code: 'div-gpt-ad-1515779430602--15',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485962'
}
}]
},{
code: 'div-gpt-ad-1515779430602--16',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485962'
}
}]
},{
code: 'div-gpt-ad-1515779430602--17',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485962'
}
}]
},{
code: 'div-gpt-ad-1515779430602--18',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485962'
}
}]
},{
code: 'div-gpt-ad-1515779430602--19',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485962'
}
}]
},{
code: 'div-gpt-ad-1515779430602--20',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485962'
}
}]
},{
code: 'div-gpt-ad-1515779430602--21',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485962'
}
}]
},{
code: 'div-gpt-ad-1515779430602--22',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485962'
}
}]
},{
code: 'div-gpt-ad-1515779430602--23',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485962'
}
}]
},{
code: 'div-gpt-ad-1515779430602--24',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: '12485962'
}
}]
}];
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: initAdserver
});
});
function initAdserver() {
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
});
}
setTimeout(function() {
initAdserver();
}, PREBID_TIMEOUT);
googletag.cmd.push(function() {
googletag.defineSlot('/49859683/RDV_web', div_2_sizes, 'div-gpt-ad-1498674722723-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
//
// Begin comScore Tag
var _comscore = _comscore || [];
_comscore.push({ c1: "2", c2: "5641052" });
(function() {
var s = document.createElement("script"), el = document.getElementsByTagName("script")[0]; s.async = true;
s.src = (document.location.protocol == "https:" ? "https://sb" : "https://b") + ".scorecardresearch.com/beacon.js";
el.parentNode.insertBefore(s, el);
})();
// End comScore Tag
//
var domain= "rincondelvago.com";
//-->
Compartir
0 Me sirvió
0 No me sirvió
ORDENACIÓN DE ARRAYS
En este apartado, estudiaremos los diferentes métodos de ordenación de arrays, teniendo mucha importancia el tiempo que tarde la función ordenar.
SELECCIÓN DIRECTA
Una vez de obtener un array de valores enteros, seleccionaremos aquel elemento que tenga el valor mínimo, intercambiando con el primer elemento del array.
Algoritmo:
1-Seleccionar aquel elemento que tenga valor mínimo.
2-Intercambiar con el primer elemento.
Ejemplo:
44 55 12 42 94 18 6 67
6 55 12 42 94 18 44 67
6 12 55 42 94 18 44 67
6 12 18 42 94 55 44 67
6 12 18 42 94 55 44 67
6 12 18 42 44 55 94 67
6 12 18 42 44 55 94 67
6 12 18 42 44 55 67 94
*Los valores que debemos cambiar.
A continuación introduciremos el programa que realiza la selección directa para un array de 5000 elementos. Analizando en ella también el tiempo que necesita para ordenar dicho array. Mediante el resultado del tiempo obtenido, compararemos las calidades de los métodos.
PROGRAMA
program sel_dir;
uses crt,dos;
const
lim=5000;
type
lista=array [1..lim] of integer;
var
l:lista;
i:integer;
h,m,s,c,h1,m1,s1,c1:word;
procedure ordenar (var l:lista;lim:integer);
var
i,menor,pos2,j,aux:integer;
begin
for i:=1 to lim do
begin
menor:=l[i];
pos2:=i;
for j:=(i+1) to lim do
if (l[j]<menor) then
begin
menor:=l[j];
pos2:=j;
end;
if (menor<>l[i]) then
begin
aux:=l[i];
l[i]:=menor;
l[pos2]:=aux;
end;
end;
end;
begin
randomize;
for i:=1 to lim do
l[i]:=random (lim);
gettime (h,m,s,c);
ordenar (l,lim);
gettime (h1,m1,s1,c1);
for i:=1 to lim do
writeln (l[i]);
writeln ('Ha tardado: ',h1-h,':',m1-m,':',s1-s,':',c1-c,' tiempo');
end.
El tiempo invertido el la ordenación de 5000 elementos: 0h:0m:0s:22c
1
2
Descargar
Enviado por: El remitente no desea revelar su nombre Idioma: castellanoPaís: España