SlideShare una empresa de Scribd logo
Declaremos un arreglo de 9 posiciones con números aleatorios...




                   Guillermo Antonio Osorio Contreras (302-B)
El algoritmo del método de ordenamiento estará formado
por tres procesos:

   •   QuickSort, proceso que inicia el ordenamiento.
   •   Encuentra Pivote, busca el mejor pivote a partir
       del primer elemento del vector
   •   Partición, va comparando por ambos extremos e
       intercambia en caso de ser necesario
1      2   3    4    5    6    7    8     9
      44 75 23 43 55 12 64 77 33

Declaramos el primer elemento del arreglo como primero
Y al ultimo como ultimo.

      1    2     3   4    5     6    7    8     9
     44 75 23 43 55 12 64 77 33

   Primero                                    Ultimo
1    2   3     4    5    6    7    8    9
   44 75 23 43 55 12 64 77 33


   Primero                                 Ultimo

Pivote

  Declaramos el primero como el pivote del arreglo.
1   2   3   4   5    6    7    8     9
Pivote
 44         44 75 23 43 55 12 64 77 33


            Primero                                 Ultimo

          Up                                      Down

         Colocamos a Up como Primero y Down como Ultimo.
1   2    3   4   5    6    7      8     9
Pivote    44 75 23 43 55 12 64 77 33
 44

          Primero                                     Ultimo

         Up           Up                            Down


 Muevo Up al primer valor mayor que el pivote


Despues movemos Down al primer valor de derecha a izquierda
menor que el pivote (en este caso Down no se mueve).
1   2      3   4    5    6    7    8      9
Pivote   44 75 23 43 55 12 64 77 33
 44

          Primero                                   Ultimo
                    Up                      Down

    Ahora intercambiamos los valores de Up y Down

         1    2     3    4   5    6    7    8       9
         44 33 23 43 55 12 64 77 75
1    2    3    4    5     6    7    8     9
  Pivote   44 33 23 43 55 12 64 77 75
   44

            Primero                                   Ultimo
                      Up                      Down
Desde la posicion en que se encuentra movemos Up a un valor mayor
que el pivote. 1 2 3 4 5 6 7 8 9

            44 33 23 43 55 12 64 77 75

            Primero                                   Ultimo
                                Up             Down
1    2    3    4    5    6     7    8     9
Pivote
 44      44 33 23 43 55 12 64 77 75

         Primero
                              Up              Down       Ultimo
                                   Down

 Cambiamos Down a la posicion menor que el pivote recorriendo de
 Derecha a Izquierda
1    2   3    4    5   6      7     8    9
Pivote
 44      44 33 23 43 55 12 64 77 75

          Primero
                             Up              Down       Ultimo
                                  Down

    Intercambiamos los valores de Up y Down…
          1    2    3   4    5    6   7      8      9
         44 33 23 43 12 55 64 77 75
1    2    3     4    5    6    7    8     9
Pivote   44 33 23 43 12 55 64 77 75
 44
          Primero              Up Down                   Ultimo

   Movemos Up desde la posicion en que se encuetra a la primera
   posicion mayor que el pivote y Down a la primera posicion de
   derecha a Izquierda3 4 que el pivote.7 8 9
           1 2         menor 5 6

         44 33 23 43 12 55 64 77 75

         Primero
                               Up Down             Ultimo
Como Up y Down se cruzaron, entonces debemos
         intercambiar el valor de Down por el pivote.


Pivote       1    2    3   4    5      6   7   8    9
 44
           12 33 23 43 44 55 64 77 75

           Primero                  Down           Ultimo
                            PivIndex

 Ahora notemos que todos los valores debajo de PivIndex son
 menores que el y los que estan por encima son mayores que el.
Esto nos da ahora dos nuevos subarreglos que hay que ordenar


         1    2    3     4    5    6     7    8     9
      12 33 23 43 44 55 64 77 75

  Primero 1         Ultimo 1 Primero 2            Ultimo 2
                         PivIndex

Se debe repetir el proceso hasta que los subarreglos estén
ordenados, lo cual nos dará como resultado el arreglo ordenado.
Guillermo Antonio Osorio Contreras (302-B)

Más contenido relacionado

Último

Hablemos de ESI para estudiantes Cuadernillo
Hablemos de ESI para estudiantes CuadernilloHablemos de ESI para estudiantes Cuadernillo
Hablemos de ESI para estudiantes Cuadernillo
Mónica Sánchez
 
tema 7. Los siglos XVI y XVII ( resumen)
tema 7. Los siglos XVI y XVII ( resumen)tema 7. Los siglos XVI y XVII ( resumen)
tema 7. Los siglos XVI y XVII ( resumen)
saradocente
 
El Cerebro se Cambia a si Mismo-Norman Doidge.pdf
El Cerebro se Cambia a si Mismo-Norman Doidge.pdfEl Cerebro se Cambia a si Mismo-Norman Doidge.pdf
El Cerebro se Cambia a si Mismo-Norman Doidge.pdf
Robert Zuñiga Vargas
 
efemérides del mes de junio 2024 (1).pptx
efemérides del mes de junio 2024 (1).pptxefemérides del mes de junio 2024 (1).pptx
efemérides del mes de junio 2024 (1).pptx
acgtz913
 
2° año LA VESTIMENTA-ciencias sociales 2 grado
2° año LA VESTIMENTA-ciencias sociales 2 grado2° año LA VESTIMENTA-ciencias sociales 2 grado
2° año LA VESTIMENTA-ciencias sociales 2 grado
GiselaBerrios3
 
Power Point: El espiritismo desenmascarado
Power Point: El espiritismo desenmascaradoPower Point: El espiritismo desenmascarado
Power Point: El espiritismo desenmascarado
https://gramadal.wordpress.com/
 
SEMIOLOGIA DE HEMORRAGIAS DIGESTIVAS.pptx
SEMIOLOGIA DE HEMORRAGIAS DIGESTIVAS.pptxSEMIOLOGIA DE HEMORRAGIAS DIGESTIVAS.pptx
SEMIOLOGIA DE HEMORRAGIAS DIGESTIVAS.pptx
Osiris Urbano
 
Mundo ABC Examen 1 Grado- Tercer Trimestre.pdf
Mundo ABC Examen 1 Grado- Tercer Trimestre.pdfMundo ABC Examen 1 Grado- Tercer Trimestre.pdf
Mundo ABC Examen 1 Grado- Tercer Trimestre.pdf
ViriEsteva
 
CUENTOS EN MAYÚSCULAS PARA APRENDER A LEER.pdf
CUENTOS EN MAYÚSCULAS PARA APRENDER A LEER.pdfCUENTOS EN MAYÚSCULAS PARA APRENDER A LEER.pdf
CUENTOS EN MAYÚSCULAS PARA APRENDER A LEER.pdf
Inslvarez5
 
Inteligencia Artificial para Docentes HIA Ccesa007.pdf
Inteligencia Artificial para Docentes  HIA  Ccesa007.pdfInteligencia Artificial para Docentes  HIA  Ccesa007.pdf
Inteligencia Artificial para Docentes HIA Ccesa007.pdf
Demetrio Ccesa Rayme
 
p4s.co Ecosistema de Ecosistemas - Diagrama.pdf
p4s.co Ecosistema de Ecosistemas - Diagrama.pdfp4s.co Ecosistema de Ecosistemas - Diagrama.pdf
p4s.co Ecosistema de Ecosistemas - Diagrama.pdf
DavidCamiloMosquera
 
Lecciones 10 Esc. Sabática. El espiritismo desenmascarado docx
Lecciones 10 Esc. Sabática. El espiritismo desenmascarado docxLecciones 10 Esc. Sabática. El espiritismo desenmascarado docx
Lecciones 10 Esc. Sabática. El espiritismo desenmascarado docx
Alejandrino Halire Ccahuana
 
Docentes y el uso de chatGPT en el Aula Ccesa007.pdf
Docentes y el uso de chatGPT   en el Aula Ccesa007.pdfDocentes y el uso de chatGPT   en el Aula Ccesa007.pdf
Docentes y el uso de chatGPT en el Aula Ccesa007.pdf
Demetrio Ccesa Rayme
 
Manual de procedimiento para gráficos HC
Manual de procedimiento para gráficos HCManual de procedimiento para gráficos HC
Manual de procedimiento para gráficos HC
josseanlo1581
 
Sesión: El espiritismo desenmascarado.pdf
Sesión: El espiritismo desenmascarado.pdfSesión: El espiritismo desenmascarado.pdf
Sesión: El espiritismo desenmascarado.pdf
https://gramadal.wordpress.com/
 
Camus, Albert - El Extranjero.pdf
Camus, Albert -        El Extranjero.pdfCamus, Albert -        El Extranjero.pdf
Camus, Albert - El Extranjero.pdf
AlexDeLonghi
 
pueblos originarios de chile presentacion twinkl.pptx
pueblos originarios de chile presentacion twinkl.pptxpueblos originarios de chile presentacion twinkl.pptx
pueblos originarios de chile presentacion twinkl.pptx
RAMIREZNICOLE
 
Guia Practica de ChatGPT para Docentes Ccesa007.pdf
Guia Practica de ChatGPT para Docentes Ccesa007.pdfGuia Practica de ChatGPT para Docentes Ccesa007.pdf
Guia Practica de ChatGPT para Docentes Ccesa007.pdf
Demetrio Ccesa Rayme
 
Nuevos espacios,nuevos tiempos,nuevas practica.pptx
Nuevos espacios,nuevos tiempos,nuevas practica.pptxNuevos espacios,nuevos tiempos,nuevas practica.pptx
Nuevos espacios,nuevos tiempos,nuevas practica.pptx
lautyzaracho4
 

Último (20)

Hablemos de ESI para estudiantes Cuadernillo
Hablemos de ESI para estudiantes CuadernilloHablemos de ESI para estudiantes Cuadernillo
Hablemos de ESI para estudiantes Cuadernillo
 
tema 7. Los siglos XVI y XVII ( resumen)
tema 7. Los siglos XVI y XVII ( resumen)tema 7. Los siglos XVI y XVII ( resumen)
tema 7. Los siglos XVI y XVII ( resumen)
 
El Cerebro se Cambia a si Mismo-Norman Doidge.pdf
El Cerebro se Cambia a si Mismo-Norman Doidge.pdfEl Cerebro se Cambia a si Mismo-Norman Doidge.pdf
El Cerebro se Cambia a si Mismo-Norman Doidge.pdf
 
efemérides del mes de junio 2024 (1).pptx
efemérides del mes de junio 2024 (1).pptxefemérides del mes de junio 2024 (1).pptx
efemérides del mes de junio 2024 (1).pptx
 
2° año LA VESTIMENTA-ciencias sociales 2 grado
2° año LA VESTIMENTA-ciencias sociales 2 grado2° año LA VESTIMENTA-ciencias sociales 2 grado
2° año LA VESTIMENTA-ciencias sociales 2 grado
 
Power Point: El espiritismo desenmascarado
Power Point: El espiritismo desenmascaradoPower Point: El espiritismo desenmascarado
Power Point: El espiritismo desenmascarado
 
SEMIOLOGIA DE HEMORRAGIAS DIGESTIVAS.pptx
SEMIOLOGIA DE HEMORRAGIAS DIGESTIVAS.pptxSEMIOLOGIA DE HEMORRAGIAS DIGESTIVAS.pptx
SEMIOLOGIA DE HEMORRAGIAS DIGESTIVAS.pptx
 
Mundo ABC Examen 1 Grado- Tercer Trimestre.pdf
Mundo ABC Examen 1 Grado- Tercer Trimestre.pdfMundo ABC Examen 1 Grado- Tercer Trimestre.pdf
Mundo ABC Examen 1 Grado- Tercer Trimestre.pdf
 
CUENTOS EN MAYÚSCULAS PARA APRENDER A LEER.pdf
CUENTOS EN MAYÚSCULAS PARA APRENDER A LEER.pdfCUENTOS EN MAYÚSCULAS PARA APRENDER A LEER.pdf
CUENTOS EN MAYÚSCULAS PARA APRENDER A LEER.pdf
 
Inteligencia Artificial para Docentes HIA Ccesa007.pdf
Inteligencia Artificial para Docentes  HIA  Ccesa007.pdfInteligencia Artificial para Docentes  HIA  Ccesa007.pdf
Inteligencia Artificial para Docentes HIA Ccesa007.pdf
 
p4s.co Ecosistema de Ecosistemas - Diagrama.pdf
p4s.co Ecosistema de Ecosistemas - Diagrama.pdfp4s.co Ecosistema de Ecosistemas - Diagrama.pdf
p4s.co Ecosistema de Ecosistemas - Diagrama.pdf
 
Lecciones 10 Esc. Sabática. El espiritismo desenmascarado docx
Lecciones 10 Esc. Sabática. El espiritismo desenmascarado docxLecciones 10 Esc. Sabática. El espiritismo desenmascarado docx
Lecciones 10 Esc. Sabática. El espiritismo desenmascarado docx
 
Docentes y el uso de chatGPT en el Aula Ccesa007.pdf
Docentes y el uso de chatGPT   en el Aula Ccesa007.pdfDocentes y el uso de chatGPT   en el Aula Ccesa007.pdf
Docentes y el uso de chatGPT en el Aula Ccesa007.pdf
 
Manual de procedimiento para gráficos HC
Manual de procedimiento para gráficos HCManual de procedimiento para gráficos HC
Manual de procedimiento para gráficos HC
 
A VISITA DO SENHOR BISPO .
A VISITA DO SENHOR BISPO                .A VISITA DO SENHOR BISPO                .
A VISITA DO SENHOR BISPO .
 
Sesión: El espiritismo desenmascarado.pdf
Sesión: El espiritismo desenmascarado.pdfSesión: El espiritismo desenmascarado.pdf
Sesión: El espiritismo desenmascarado.pdf
 
Camus, Albert - El Extranjero.pdf
Camus, Albert -        El Extranjero.pdfCamus, Albert -        El Extranjero.pdf
Camus, Albert - El Extranjero.pdf
 
pueblos originarios de chile presentacion twinkl.pptx
pueblos originarios de chile presentacion twinkl.pptxpueblos originarios de chile presentacion twinkl.pptx
pueblos originarios de chile presentacion twinkl.pptx
 
Guia Practica de ChatGPT para Docentes Ccesa007.pdf
Guia Practica de ChatGPT para Docentes Ccesa007.pdfGuia Practica de ChatGPT para Docentes Ccesa007.pdf
Guia Practica de ChatGPT para Docentes Ccesa007.pdf
 
Nuevos espacios,nuevos tiempos,nuevas practica.pptx
Nuevos espacios,nuevos tiempos,nuevas practica.pptxNuevos espacios,nuevos tiempos,nuevas practica.pptx
Nuevos espacios,nuevos tiempos,nuevas practica.pptx
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Quick sort - Estructura de Datos

  • 1. Declaremos un arreglo de 9 posiciones con números aleatorios... Guillermo Antonio Osorio Contreras (302-B)
  • 2. El algoritmo del método de ordenamiento estará formado por tres procesos: • QuickSort, proceso que inicia el ordenamiento. • Encuentra Pivote, busca el mejor pivote a partir del primer elemento del vector • Partición, va comparando por ambos extremos e intercambia en caso de ser necesario
  • 3. 1 2 3 4 5 6 7 8 9 44 75 23 43 55 12 64 77 33 Declaramos el primer elemento del arreglo como primero Y al ultimo como ultimo. 1 2 3 4 5 6 7 8 9 44 75 23 43 55 12 64 77 33 Primero Ultimo
  • 4. 1 2 3 4 5 6 7 8 9 44 75 23 43 55 12 64 77 33 Primero Ultimo Pivote Declaramos el primero como el pivote del arreglo.
  • 5. 1 2 3 4 5 6 7 8 9 Pivote 44 44 75 23 43 55 12 64 77 33 Primero Ultimo Up Down Colocamos a Up como Primero y Down como Ultimo.
  • 6. 1 2 3 4 5 6 7 8 9 Pivote 44 75 23 43 55 12 64 77 33 44 Primero Ultimo Up Up Down Muevo Up al primer valor mayor que el pivote Despues movemos Down al primer valor de derecha a izquierda menor que el pivote (en este caso Down no se mueve).
  • 7. 1 2 3 4 5 6 7 8 9 Pivote 44 75 23 43 55 12 64 77 33 44 Primero Ultimo Up Down Ahora intercambiamos los valores de Up y Down 1 2 3 4 5 6 7 8 9 44 33 23 43 55 12 64 77 75
  • 8. 1 2 3 4 5 6 7 8 9 Pivote 44 33 23 43 55 12 64 77 75 44 Primero Ultimo Up Down Desde la posicion en que se encuentra movemos Up a un valor mayor que el pivote. 1 2 3 4 5 6 7 8 9 44 33 23 43 55 12 64 77 75 Primero Ultimo Up Down
  • 9. 1 2 3 4 5 6 7 8 9 Pivote 44 44 33 23 43 55 12 64 77 75 Primero Up Down Ultimo Down Cambiamos Down a la posicion menor que el pivote recorriendo de Derecha a Izquierda
  • 10. 1 2 3 4 5 6 7 8 9 Pivote 44 44 33 23 43 55 12 64 77 75 Primero Up Down Ultimo Down Intercambiamos los valores de Up y Down… 1 2 3 4 5 6 7 8 9 44 33 23 43 12 55 64 77 75
  • 11. 1 2 3 4 5 6 7 8 9 Pivote 44 33 23 43 12 55 64 77 75 44 Primero Up Down Ultimo Movemos Up desde la posicion en que se encuetra a la primera posicion mayor que el pivote y Down a la primera posicion de derecha a Izquierda3 4 que el pivote.7 8 9 1 2 menor 5 6 44 33 23 43 12 55 64 77 75 Primero Up Down Ultimo
  • 12. Como Up y Down se cruzaron, entonces debemos intercambiar el valor de Down por el pivote. Pivote 1 2 3 4 5 6 7 8 9 44 12 33 23 43 44 55 64 77 75 Primero Down Ultimo PivIndex Ahora notemos que todos los valores debajo de PivIndex son menores que el y los que estan por encima son mayores que el.
  • 13. Esto nos da ahora dos nuevos subarreglos que hay que ordenar 1 2 3 4 5 6 7 8 9 12 33 23 43 44 55 64 77 75 Primero 1 Ultimo 1 Primero 2 Ultimo 2 PivIndex Se debe repetir el proceso hasta que los subarreglos estén ordenados, lo cual nos dará como resultado el arreglo ordenado.
  • 14. Guillermo Antonio Osorio Contreras (302-B)