Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita90b71d

Browse files
author
night
committed
add time complexity
1 parent268ac01 commita90b71d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎src/main/java/com/blankj/hard/_126/Solution.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import kotlin.collections.HashMap
66
importkotlin.collections.HashSet
77
importkotlin.math.max
88

9+
/**
10+
* 假设 beginword 和 endword 之间的距离是 d。每个节点可以扩展出 k 个节点。
11+
* 那么正常的时间复杂就是 k^d
12+
* 双向搜索的时间复杂度就是 k^(d/2) + k^(d/2)
13+
*/
914
classSolution {
1015
funfindLadders(
1116
beginWord:String,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp