En lecciones anteriores, aprendiste sobre la longitud.
The length of an object is the distance from one of its ends to the other.
La longitud de un objeto es la distancia de uno de sus extremos al otro.
Different objects have different lengths. 🤗
Cada objeto tiene una longitud diferente.
Some are shorter, and some are longer.
Algunos son más cortos y otros más largos.
We can arrange different objects based on their length.
Podemos ordenar diferentes objetos en función de su longitud.
Arranging things in a certain order is called sorting.
Ordenar las cosas se llama clasificar.
Sorting Objects from Shortest to Longest
Ordenar objetos del más corto al más largo
To sort objects from shortest to longest, follow these steps:
Para ordenar los objetos del más corto al más largo, sigue estos pasos:
Step 1:Look through all items and see which is the shortest of all. This will go first on your sorted list. Step 2:Look through the remaining items to find the shortest after that. Add it to your sorted list. Step 3:Repeat step 2 until all items are sorted.
Pongamos un ejemplo.
Let's try an example.
Ordena estos objetos del más corto al más largo.
👉 Arrange these objects from shortest to longest.
Empiece por el paso 1.
Start with Step 1.
¿Qué objeto es el más corto de todos?
Which object is the shortest of all? 🤔
¡Buen trabajo! Es la goma de borrar.
Good job! 👏 It's the eraser.
Ahora, pasemos al paso 2.
Now, let's move to Step 2.
¿Cuál es el siguiente objeto más corto? ¿Es la regla?
Which is the next shortest object? Is it the ruler? 🤔
¡No! Es el lápiz.
No! It's the pencil. 🤓
¡Muy bien!
Very good!
Terminemos con el paso 3.
Let's finish with Step 3.
Sólo queda un objeto, la regla, así que va al final.
There is only one item left, the ruler, so it goes at the end.
¡Ya está! ¡Acabas de ordenar los objetos por longitud!
There you go! You just sorted the objects by length!
Puede utilizar los símbolos de comparación <, y > para mostrar su lista ordenada:
Consejo: Acabas de aprender un algoritmo de ordenación.
Tip: You just learned a sortingalgorithm. 😺
Consejo: los algoritmos son como los programas de ordenador: un conjunto de pasos para resolver un problema o crear algo.
Tip: Algorithms are like computer programs. They're a set of steps you take to solve a problem or make something.
Consejo: Este algoritmo de ordenación se llama "Bubble sort".
Tip: This sorting algorithm is called "Bubble sort".
Hay muchas otras formas de ordenar las cosas, pero por ahora nos ceñiremos a la ordenación por burbujas.
There are lots of other ways to sort things, but we'll stick to bubble sort for now. 👨💻
Ordenar objetos del más largo al más corto
Sorting Objects from Longest to Shortest
Hagamos lo contrario de lo que hicimos antes.
Let's do the opposite of what we did before.
Paso 1: Empieza con el objeto más largo y colócalo primero.. Paso 2: Busca el siguiente objeto más largo y colócalo después.. Paso 3: Repite el paso 2 hasta que todo esté ordenado.
Step 1: Start with the longest object, and place it first. Step 2:Find the next longest object and place it after. Step 3:Repeat step 2 until everything is sorted.
Probemos con otro ejemplo.
Let's try another example.
Ordena estos objetos del más alto al más bajo.
👉 Arrange these objects from tallest to shortest.
¡Adelante! ¡Pruébalo!
Go ahead! Try it out!
Empieza por el objeto más alto y termina por el más bajo.
Start from the tallest object and end with the shortest object.
¡Gran trabajo! ¡Eso estuvo perfecto!
Great job! That was perfect! 😎
Ya sabes cómo ordenar objetos por su longitud.
You now know how to sort objects by length!
A continuación, empieza la práctica. Clasificar es divertido.
Next, start the practice. 👇 Sorting is fun.
Lesson Streak
0 days
Start Practice
Iniciar la práctica
Complete the practice to earn 1 Create Credit
1,000 Create Credits is worth $1 in real AI compute time.
1 Create Credit is enough to get 1 question answered, or to generate 1 image from text, in the tools tab.