SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
2010 CS
2010 CS                                      	


                                 	


    




    




Copyright© 2010 tniky1 All rights reserved.        Page 2
2010 CS                                      	


                                     	


    
      - 
      - 
    
      - 
    
      - Θ            	


Copyright© 2010 tniky1 All rights reserved.        Page 3
2010 CS                                      	


                             	
                                                   	




Copyright© 2010 tniky1 All rights reserved.        Page 4
2010 CS                                              	


                             	
                            j	
                                          1   	
   1 2 3         4   5 6	
                                                   2 5 4 6 1 3
                                                           i	


                                                      length[A]	

     procedure Insertion-Sort(A)
      for j ← 2 to length[A]
        do key ← A[j]
          i←j−1
          while i > 0 and A[i] > key
             do A[i+1] ← A[i]
             i←i−1
          A[i+1] ← key	
Copyright© 2010 tniky1 All rights reserved.                                  Page 5
2010 CS                                      	


                                                   	



                                                             	

                                      (1)




                                   (2)                  	


Copyright© 2010 tniky1 All rights reserved.                       Page 6
2010 CS                                                      	


                                                  	


   
   
        -  A[1...j-1]                                                   →

                                                         j
                                                         	

                                                2 5 4 6 1 3

                                              A[1...j-1]	
                                                                   	




Copyright© 2010 tniky1 All rights reserved.                                 Page 7
2010 CS                                      	


                                                                      	


    
      - 
           -                                                	
      - 
           - 


      - 
           - 
                (                                  )   	

                                                                 	

Copyright© 2010 tniky1 All rights reserved.                 Page 8
2010 CS                                                      	


                                                                                                     	
                                                         j
                                                         	

                                                2 5 4 6 1 3

                                              A[1...j-1]	
                                                                          	

      for j ← 2 to length[A]                                       J=2
        do key ← A[j]                                                     A[1]
                                                                          A[1..j-1]
          i←j−1
          while i > 0 and A[i] > key                               A[j]
                                                                               A[j-1],A[j-2]...
             do A[i+1] ← A[i]                                                                 A[j]
             i←i−1                                                   (A[1..j-1]                           )
          A[i+1] ← key	
Copyright© 2010 tniky1 All rights reserved.                                                                   Page 9
2010 CS                                                	


                                                                                         	
                                                                     j=n+1	

                                              1 2 3 4 5 6

                                              A[1...j-1]=A[1..n]	




      for j ← 2 to length[A]                                         j=n+1
        do key ← A[j]
                                                                     A[1..j-1]=A[1..n]           !
          i←j−1
          while i > 0 and A[i] > key
             do A[i+1] ← A[i]
             i←i−1
          A[i+1] ← key	
Copyright© 2010 tniky1 All rights reserved.                                                   Page 10
2010 CS                                      	


                                                   	




                                      (1)

                                                             	



                                   (2)                  	


Copyright© 2010 tniky1 All rights reserved.                       Page 11
2010 CS                                      	


                                                            	


    
      - 
      - 
      -                               (                          )
    
      -                                            (       DB
                                   DB                  )
      - 


Copyright© 2010 tniky1 All rights reserved.                          Page 12
2010 CS                                                      	


                                                                            	
                                                  j	
                                              1 2 3     4    5 6	
                                              2 5 4 6 1 3
                                                  i	
                                      	
                                                   n    	
                                                                             	

    for j ← 2 to length[A]                                            n
      do key ← A[j]                                                  n-1
        i←j−1                                                        n-1
        while i > 0 and A[i] > key
           do A[i+1] ← A[i]
           i←i−1                                                                  tj
        A[i+1] ← key	
                                               n-1
                                                                       	
                                                                                  (       )	
Copyright© 2010 tniky1 All rights reserved.                                            Page 13
2010 CS                                      	


                                                         	
                                                    	
               	

       for j ← 2 to length[A]                      C1          n
         do key ← A[j]                             C2         n-1
           i←j−1                                   C3         n-1
           while i > 0 and A[i] > key              C4
              do A[i+1] ← A[i]                     C5
              i←i−1                                C6
           A[i+1] ← key	
                          C7         n-1
                                                                	
                  T(n)	




Copyright© 2010 tniky1 All rights reserved.                               Page 14
2010 CS                                               	


                                                                	
                 T(n)	



                                                   (        )
                                                                         j	
                                                                     1 2 3     4   5 6	
    [                 ]                                              5 6 4 3 2 1
           i=0                                                           i	
    tj=i
                                                                                           	



                                              	
                                                	




Copyright© 2010 tniky1 All rights reserved.                                          Page 15
2010 CS                                                	


                                                   	


    
      - 
           - 
                                              	

    
      - 
           -                                                 	
           - 




Copyright© 2010 tniky1 All rights reserved.                       Page 16
2010 CS                                      	


                                     	
                                                   	




Copyright© 2010 tniky1 All rights reserved.             Page 17
2010 CS                                           	


                                              	


                                                          A 2 4 5 7 1 2 3 6
                                                           p	
              q	
               r	


                                                            i	
                         j	
                                                        1 2 3     4   5	
           1 2 3           4    5   	
                                                    L	
 2 4 5 7 ∞                 R	
 1 2 3 6 ∞


                                                            n1	
                          n2	
                                                                            k
                                                                            	

                                                           A 1 2 2 3 4 2 3 6
                                                            p	
     q	
      r	


Copyright© 2010 tniky1 All rights reserved.                                                             Page 18
2010 CS                                                           	


                                              	
     
       -  A             L        R                                                     k−p

       -  L[i]       R[j]            L         R                   A
                                                                    	
                                                   i	
                                  j	
                                         1 2 3           4   5	
               1 2 3    4     5   	
                                   L	
 2 4 5 7 ∞                         R	
 1 2 3 6 ∞
                                                             	
                                   	
                                                                          k
                                                                          	

                                               A 1 2 2 3 4 2 3 6
                                                 p	
           r	
                                                                                  	
Copyright© 2010 tniky1 All rights reserved.                                                            Page 19
2010 CS                                            	

                                                              i	
                                  j	
                                              	
         1 2 3      4   5	
               1 2 3   4      5     	
                                                   L	
 2 4 5 7 ∞                    R	
 1 2 3 6 ∞
                                                                        	
                                     	
                                                                                     k
                                                                                     	

                                                           A 1 2 2 3 4 2 3 6
                                                             p	
            r	
                                                                                             	

                                                     k=p
                                                             A[p..k-1]
                                                     i=j=1                    L,R


                                                     L[i]<=R[j]
                                                     L[i] A
                                                     L[i] A[k]
                                                     i k                                          L[i],R[j]

Copyright© 2010 tniky1 All rights reserved.                                                                  Page 20
2010 CS                                            	

                                                              i	
                             j	
                                              	
         1 2 3      4   5	
           1 2 3   4     5       	
                                                   L	
 2 4 5 7 ∞              R	
 1 2 3 6 ∞
                                                                        	
                                  	
                                                                                 k
                                                                                 	

                                                           A 1 2 2 3 4 2 3 6
                                                             p	
            r	
                                                                                         	

                                                     k=r+1
                                                             A[p..k-1]=A[p..r]                          !




                                                         2                                                  n
                                                          (n1+n2 )            : Θ(n)


Copyright© 2010 tniky1 All rights reserved.                                                             Page 21
2010 CS                                      	


                                  	
                         MERGE         	

                                                   	




                                                        	



Copyright© 2010 tniky1 All rights reserved.                          Page 22
2010 CS                                                    	


                                                       	
         A             p          r                    	
                                                                       p    r
                                                                           	
                                                                 A	
                           /* (               ) */	




Copyright© 2010 tniky1 All rights reserved.                                     Page 23
2010 CS                                                	


                                                                  	

      -                a                                          1/b




                                        	
         	
        	

           -  If n <= c
           -  D(n):
           -  C(n):                           	




Copyright© 2010 tniky1 All rights reserved.                             Page 24
2010 CS                                                      	


                                                                            	
                                              	
              	
   	

                 T(n) = aT(n/b) + D(n) + C(n)

               2                                                    Merge          Θ(n)
               1/2                                                               	
        a = b = 2	
                                              D(n) = Θ(1)	




                   T(n) = 2T(n/2) + Θ(1) + Θ(n)                             if n > 1
                       =Θ(1)                                                if n = 1



Copyright© 2010 tniky1 All rights reserved.                                               Page 25
2010 CS                                            	


                                                               	




                                              cn(        )	



Copyright© 2010 tniky1 All rights reserved.                         Page 26
2010 CS                                      	


                                                   	


         log2n              	




Copyright© 2010 tniky1 All rights reserved.             Page 27
2010 CS                                           	


                   	


                                                       OK

      - 
      -                                       	




Copyright© 2010 tniky1 All rights reserved.              Page 28

Más contenido relacionado

Destacado

デザインパターン(state,strategy,template)
デザインパターン(state,strategy,template)デザインパターン(state,strategy,template)
デザインパターン(state,strategy,template)tniky1
 
アルゴリズムイントロダクション 8章
アルゴリズムイントロダクション 8章アルゴリズムイントロダクション 8章
アルゴリズムイントロダクション 8章tniky1
 
アルゴリズムイントロダクション 14章
アルゴリズムイントロダクション 14章アルゴリズムイントロダクション 14章
アルゴリズムイントロダクション 14章tniky1
 
動画像圧縮(コーデック)
動画像圧縮(コーデック)動画像圧縮(コーデック)
動画像圧縮(コーデック)tniky1
 
スマホUXラボ「ユーザテストLive! 見学会」
スマホUXラボ「ユーザテストLive! 見学会」スマホUXラボ「ユーザテストLive! 見学会」
スマホUXラボ「ユーザテストLive! 見学会」Tarumoto Tetsuya
 
Npc april fool2014
Npc april fool2014Npc april fool2014
Npc april fool2014Ken Ogura
 
The FizzBuzz Programing Contest
The FizzBuzz Programing ContestThe FizzBuzz Programing Contest
The FizzBuzz Programing ContestJunichi Ito
 
中の下のエンジニアを脱出するための仕事術
中の下のエンジニアを脱出するための仕事術中の下のエンジニアを脱出するための仕事術
中の下のエンジニアを脱出するための仕事術Noriaki Kadota
 
バンディットアルゴリズム入門と実践
バンディットアルゴリズム入門と実践バンディットアルゴリズム入門と実践
バンディットアルゴリズム入門と実践智之 村上
 
今日から使える! みんなのクラスタリング超入門
今日から使える! みんなのクラスタリング超入門今日から使える! みんなのクラスタリング超入門
今日から使える! みんなのクラスタリング超入門toilet_lunch
 
機会学習ハッカソン:ランダムフォレスト
機会学習ハッカソン:ランダムフォレスト機会学習ハッカソン:ランダムフォレスト
機会学習ハッカソン:ランダムフォレストTeppei Baba
 
ロジスティック回帰の考え方・使い方 - TokyoR #33
ロジスティック回帰の考え方・使い方 - TokyoR #33ロジスティック回帰の考え方・使い方 - TokyoR #33
ロジスティック回帰の考え方・使い方 - TokyoR #33horihorio
 
Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜
Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜
Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜Takahiro Inoue
 
Ctfのためのpython入門
Ctfのためのpython入門Ctfのためのpython入門
Ctfのためのpython入門shiracamus
 
トピックモデルを用いた 潜在ファッション嗜好の推定
トピックモデルを用いた 潜在ファッション嗜好の推定トピックモデルを用いた 潜在ファッション嗜好の推定
トピックモデルを用いた 潜在ファッション嗜好の推定Takashi Kaneda
 
パターン認識 第10章 決定木
パターン認識 第10章 決定木 パターン認識 第10章 決定木
パターン認識 第10章 決定木 Miyoshi Yuya
 
SVMについて
SVMについてSVMについて
SVMについてmknh1122
 
はじめてでもわかるベイズ分類器 -基礎からMahout実装まで-
はじめてでもわかるベイズ分類器 -基礎からMahout実装まで-はじめてでもわかるベイズ分類器 -基礎からMahout実装まで-
はじめてでもわかるベイズ分類器 -基礎からMahout実装まで-Naoki Yanai
 

Destacado (20)

デザインパターン(state,strategy,template)
デザインパターン(state,strategy,template)デザインパターン(state,strategy,template)
デザインパターン(state,strategy,template)
 
アルゴリズムイントロダクション 8章
アルゴリズムイントロダクション 8章アルゴリズムイントロダクション 8章
アルゴリズムイントロダクション 8章
 
アルゴリズムイントロダクション 14章
アルゴリズムイントロダクション 14章アルゴリズムイントロダクション 14章
アルゴリズムイントロダクション 14章
 
動画像圧縮(コーデック)
動画像圧縮(コーデック)動画像圧縮(コーデック)
動画像圧縮(コーデック)
 
スマホUXラボ「ユーザテストLive! 見学会」
スマホUXラボ「ユーザテストLive! 見学会」スマホUXラボ「ユーザテストLive! 見学会」
スマホUXラボ「ユーザテストLive! 見学会」
 
Npc april fool2014
Npc april fool2014Npc april fool2014
Npc april fool2014
 
The FizzBuzz Programing Contest
The FizzBuzz Programing ContestThe FizzBuzz Programing Contest
The FizzBuzz Programing Contest
 
中の下のエンジニアを脱出するための仕事術
中の下のエンジニアを脱出するための仕事術中の下のエンジニアを脱出するための仕事術
中の下のエンジニアを脱出するための仕事術
 
バンディットアルゴリズム入門と実践
バンディットアルゴリズム入門と実践バンディットアルゴリズム入門と実践
バンディットアルゴリズム入門と実践
 
決定木学習
決定木学習決定木学習
決定木学習
 
今日から使える! みんなのクラスタリング超入門
今日から使える! みんなのクラスタリング超入門今日から使える! みんなのクラスタリング超入門
今日から使える! みんなのクラスタリング超入門
 
機会学習ハッカソン:ランダムフォレスト
機会学習ハッカソン:ランダムフォレスト機会学習ハッカソン:ランダムフォレスト
機会学習ハッカソン:ランダムフォレスト
 
ロジスティック回帰の考え方・使い方 - TokyoR #33
ロジスティック回帰の考え方・使い方 - TokyoR #33ロジスティック回帰の考え方・使い方 - TokyoR #33
ロジスティック回帰の考え方・使い方 - TokyoR #33
 
Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜
Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜
Map Reduce 〜入門編:仕組みの理解とアルゴリズムデザイン〜
 
一般向けのDeep Learning
一般向けのDeep Learning一般向けのDeep Learning
一般向けのDeep Learning
 
Ctfのためのpython入門
Ctfのためのpython入門Ctfのためのpython入門
Ctfのためのpython入門
 
トピックモデルを用いた 潜在ファッション嗜好の推定
トピックモデルを用いた 潜在ファッション嗜好の推定トピックモデルを用いた 潜在ファッション嗜好の推定
トピックモデルを用いた 潜在ファッション嗜好の推定
 
パターン認識 第10章 決定木
パターン認識 第10章 決定木 パターン認識 第10章 決定木
パターン認識 第10章 決定木
 
SVMについて
SVMについてSVMについて
SVMについて
 
はじめてでもわかるベイズ分類器 -基礎からMahout実装まで-
はじめてでもわかるベイズ分類器 -基礎からMahout実装まで-はじめてでもわかるベイズ分類器 -基礎からMahout実装まで-
はじめてでもわかるベイズ分類器 -基礎からMahout実装まで-
 

Último

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Último (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

アルゴリズムイントロダクション 第2章

  • 2. 2010 CS     Copyright© 2010 tniky1 All rights reserved. Page 2
  • 3. 2010 CS   -  -    -    - Θ Copyright© 2010 tniky1 All rights reserved. Page 3
  • 4. 2010 CS Copyright© 2010 tniky1 All rights reserved. Page 4
  • 5. 2010 CS j 1 1 2 3 4 5 6 2 5 4 6 1 3 i length[A] procedure Insertion-Sort(A) for j ← 2 to length[A] do key ← A[j] i←j−1 while i > 0 and A[i] > key do A[i+1] ← A[i] i←i−1 A[i+1] ← key Copyright© 2010 tniky1 All rights reserved. Page 5
  • 6. 2010 CS (1) (2) Copyright© 2010 tniky1 All rights reserved. Page 6
  • 7. 2010 CS     -  A[1...j-1] → j 2 5 4 6 1 3 A[1...j-1] Copyright© 2010 tniky1 All rights reserved. Page 7
  • 8. 2010 CS   -  -  -  -  -  -  ( ) Copyright© 2010 tniky1 All rights reserved. Page 8
  • 9. 2010 CS j 2 5 4 6 1 3 A[1...j-1] for j ← 2 to length[A] J=2 do key ← A[j] A[1] A[1..j-1] i←j−1 while i > 0 and A[i] > key A[j] A[j-1],A[j-2]... do A[i+1] ← A[i] A[j] i←i−1 (A[1..j-1] ) A[i+1] ← key Copyright© 2010 tniky1 All rights reserved. Page 9
  • 10. 2010 CS j=n+1 1 2 3 4 5 6 A[1...j-1]=A[1..n] for j ← 2 to length[A] j=n+1 do key ← A[j] A[1..j-1]=A[1..n] ! i←j−1 while i > 0 and A[i] > key do A[i+1] ← A[i] i←i−1 A[i+1] ← key Copyright© 2010 tniky1 All rights reserved. Page 10
  • 11. 2010 CS (1) (2) Copyright© 2010 tniky1 All rights reserved. Page 11
  • 12. 2010 CS   -  -  -  ( )   -  ( DB DB ) -  Copyright© 2010 tniky1 All rights reserved. Page 12
  • 13. 2010 CS j 1 2 3 4 5 6 2 5 4 6 1 3 i n for j ← 2 to length[A] n do key ← A[j] n-1 i←j−1 n-1 while i > 0 and A[i] > key do A[i+1] ← A[i] i←i−1 tj A[i+1] ← key n-1 ( ) Copyright© 2010 tniky1 All rights reserved. Page 13
  • 14. 2010 CS for j ← 2 to length[A] C1 n do key ← A[j] C2 n-1 i←j−1 C3 n-1 while i > 0 and A[i] > key C4 do A[i+1] ← A[i] C5 i←i−1 C6 A[i+1] ← key C7 n-1 T(n) Copyright© 2010 tniky1 All rights reserved. Page 14
  • 15. 2010 CS T(n) ( ) j 1 2 3 4 5 6 [ ] 5 6 4 3 2 1 i=0 i tj=i Copyright© 2010 tniky1 All rights reserved. Page 15
  • 16. 2010 CS   -  -    -  -  -  Copyright© 2010 tniky1 All rights reserved. Page 16
  • 17. 2010 CS Copyright© 2010 tniky1 All rights reserved. Page 17
  • 18. 2010 CS A 2 4 5 7 1 2 3 6 p q r i j 1 2 3 4 5 1 2 3 4 5 L 2 4 5 7 ∞ R 1 2 3 6 ∞ n1 n2 k A 1 2 2 3 4 2 3 6 p q r Copyright© 2010 tniky1 All rights reserved. Page 18
  • 19. 2010 CS   -  A L R k−p -  L[i] R[j] L R A i j 1 2 3 4 5 1 2 3 4 5 L 2 4 5 7 ∞ R 1 2 3 6 ∞ k A 1 2 2 3 4 2 3 6 p r Copyright© 2010 tniky1 All rights reserved. Page 19
  • 20. 2010 CS i j 1 2 3 4 5 1 2 3 4 5 L 2 4 5 7 ∞ R 1 2 3 6 ∞ k A 1 2 2 3 4 2 3 6 p r k=p A[p..k-1] i=j=1 L,R L[i]<=R[j] L[i] A L[i] A[k] i k L[i],R[j] Copyright© 2010 tniky1 All rights reserved. Page 20
  • 21. 2010 CS i j 1 2 3 4 5 1 2 3 4 5 L 2 4 5 7 ∞ R 1 2 3 6 ∞ k A 1 2 2 3 4 2 3 6 p r k=r+1 A[p..k-1]=A[p..r] ! 2 n (n1+n2 ) : Θ(n) Copyright© 2010 tniky1 All rights reserved. Page 21
  • 22. 2010 CS MERGE Copyright© 2010 tniky1 All rights reserved. Page 22
  • 23. 2010 CS A p r p r A /* ( ) */ Copyright© 2010 tniky1 All rights reserved. Page 23
  • 24. 2010 CS -  a 1/b -  If n <= c -  D(n): -  C(n): Copyright© 2010 tniky1 All rights reserved. Page 24
  • 25. 2010 CS T(n) = aT(n/b) + D(n) + C(n) 2 Merge Θ(n) 1/2 a = b = 2 D(n) = Θ(1) T(n) = 2T(n/2) + Θ(1) + Θ(n) if n > 1 =Θ(1) if n = 1 Copyright© 2010 tniky1 All rights reserved. Page 25
  • 26. 2010 CS cn( ) Copyright© 2010 tniky1 All rights reserved. Page 26
  • 27. 2010 CS log2n Copyright© 2010 tniky1 All rights reserved. Page 27
  • 28. 2010 CS   OK -  -  Copyright© 2010 tniky1 All rights reserved. Page 28

Notas del editor

  1. 12s それでは [ マインドマップをベースとした 複数人での情報共有システム ] について発表をはじめます。 発表者は、~です. よろしくお願いします。