From 32afe48abe25bd32d3fdefbcd3a6d7ace9f4db72 Mon Sep 17 00:00:00 2001 From: Li Miao Date: Wed, 1 Apr 2015 01:24:07 +0800 Subject: [PATCH] Merge k Sorted Lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更正时间复杂度 --- C++/chapSorting.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C++/chapSorting.tex b/C++/chapSorting.tex index a1192eb5..0a0ea2a1 100644 --- a/C++/chapSorting.tex +++ b/C++/chapSorting.tex @@ -97,7 +97,7 @@ \subsubsection{分析} \subsubsection{代码} \begin{Code} //LeetCode, Merge k Sorted Lists -// 时间复杂度O(n1+n2+...),空间复杂度O(1) +// 时间复杂度O((n1+n2+...)*K),空间复杂度O(1) -- 可利用分治思想,时间复杂度是O(N*logK),空间复杂度是O(K). class Solution { public: ListNode *mergeKLists(vector &lists) {