This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Quicksort { | |
public void sort(int[] elements) { | |
quickSort(elements, 0, elements.length-1); | |
} | |
/** | |
* Gets the position of the median of the three (left, right and | |
* the element which position is in the center between them, and | |
* moves the elements to order them |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void sort(int[] elements) { | |
int i = 1; | |
boolean hasChange = true; | |
while (hasChange && (i < elements.length)){ | |
hasChange = false; | |
for (int j = elements.length - 1; j >= i; j--){ | |
if (elements[j-1] > elements[j]){ | |
int temp = elements[j]; | |
elements[j] = elements[j-1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void sort(int[] elements) { | |
int posMin; | |
for (int i = 0; i < elements.length-1; i++) { | |
posMin = findPosMin(elements, i); //O(n) | |
int temp = elements[i]; | |
elements[i] = elements[posMin]; | |
elements[posMin] = temp; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void sort(int[] elements) { | |
int j; | |
int pivot; | |
for (int i = 1; i < elements.length; i++) { | |
pivot = elements[i]; | |
j = i-1; | |
while (j >= 0 && pivot < elements[j]) { | |
elements[j+1] = elements[j]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void sort(int[] elements) { | |
for (int i = 1; i < elements.length; i++) { | |
for (int j = elements.length - 1; j >= i; j--) { | |
if (elements[j-1] > elements[j]){ | |
int temp = elements[j]; | |
elements[j] = elements[j-1]; | |
elements[j-1] = temp; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reveal.configure({ | |
parallaxBackgroundImage: 'images/parallax.jpg', //Parallax background image | |
parallaxBackgroundSize: '', //CSS syntax, e.g. "2100px 900px" //Parallax background size | |
parallaxBackgroundHorizontal: 100, //Number of pixels to move the parallax background per slide (horizontal) | |
parallaxBackgroundVertical: 100 //Number of pixels to move the parallax background per slide (vertical) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section> | |
<h2>Y por qué no un video?</h2> | |
<video width="320" height="240" controls> | |
<source src="videos/mov_bbb.mp4" type="video/mp4"> | |
<source src="videos/mov_bbb.ogg" type="video/ogg"> | |
</video> | |
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reveal.initialize({ | |
//Parameters values... | |
//Optional reveal.js plugins | |
dependencies: [ | |
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, | |
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, | |
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, | |
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, | |
{ src: 'plugin/zoom-js/zoom.js', async: true }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reveal.initialize({ | |
controls: true, //Display controls in the bottom right corner | |
progress: true, //Display a presentation progress bar | |
slideNumber: true, //Display the page number of the current slide | |
history: true, //Push each slide change to the browser history | |
keyboard: true, //Enable keyboard shortcuts for navigation | |
overview: true, //Enable the slide overview mode | |
center: true, //Vertical centering of slides | |
touch: true, //Enables touch navigation on devices with touch input | |
loop: false, //Loop the presentation |
NewerOlder