Chip123 科技應用創新平台

 找回密碼
 申請會員

QQ登錄

只需一步,快速開始

Login

用FB帳號登入

搜索
1 2 3 4
查看: 4662|回復: 1
打印 上一主題 下一主題

[問題求助] 請問二題時間複雜度的問題

[複製鏈接]
跳轉到指定樓層
1#
發表於 2007-10-26 14:57:26 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
1.Give  the order-of-Magnitude time efficiency (in THETA)                      - R; j  k* h; L6 W# X. p& T( D
  for the algorithm.                                                            , L# n1 s, R3 c5 M! D( Y
                                                                                
1 l1 h7 g# I" G2 f& e5 T/ W: V6 _                Step 1:get values for D1, D2,,,,,, Dn                           
+ g) J; H( z# ^                Step 2:get sum=0                                                4 b- c+ B; k* a* H- C. B8 _
                Step 3:set left=1                                               ) q( v* w' _, n. \
                Step 4:repeat Step 5 to 7 until left>N                          # U. l: j. P' n; E* h  @7 A3 A1 x
                Step 5: if Dleft  is positive then                              , g; O7 q* g) e5 H1 A
                Step 6:   set sum=sum+Dleft                                     2 |) @& f% R5 x# r  k
                Step 7:   set left=left+1                                       * ]! G) S- h7 R. `% L
                Step 8: print out sum as the answer   0 V* Z8 o. g9 N

# B: c3 t/ @! x2 J8 {: K. B2 Z4 s6 Z( {( V+ N

' E; W" A3 X3 j/ Z8 B2.Give the order-of-magnitude time efficiency(in THETA)                        & {; I" ?0 Y; }- j  E8 M& r
  for the the algorithm.                                                        
# i9 `, _- }5 q3 T# i5 I; R( b8 K' E                                                                                / X) c$ r0 f9 b
                Step 1:get values for L1, L2,….. Ln                            8 e' F) W$ N1 c1 o7 ~% l, D
                Step 2:set i=0                                                  8 b5 o, c3 {& W' L" |+ D8 n7 z
                Step 3:repeat Steps 4 to 8 until i>N                           
( y$ c% j& ?- }  W                Step 4: set j=1                                                
; q5 ^& y7 N3 X8 L' z2 R. p                Step 5: repeat Steps 6 and 7 until j>N                          - V. a3 X. L. n0 h+ E
                Step 6:         print(LI,Lj)                                    * q6 F: m) R* l
                Step 7:         add 1 to the value of j                        
7 L9 a) n, F! s, I5 _! n; x5 r                Step 8: add 1 to the value      of i  ' T$ |) Q1 B/ O# z- w* ?

* |. x# `( ~( w# @: L7 r4 l求以上二題的時間複雜度
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享分享 頂 踩 分享分享
2#
發表於 2007-10-26 22:40:23 | 只看該作者
您需要登錄後才可以回帖 登錄 | 申請會員

本版積分規則

首頁|手機版|Chip123 科技應用創新平台 |新契機國際商機整合股份有限公司

GMT+8, 2025-2-23 01:14 AM , Processed in 0.155009 second(s), 17 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表