题目内容

Gale-Shapley algorithm finds a stable matching in _____ time.

A. $O(n)$
B. $ O(n\log n)$
C. $O(n^2)$

查看答案
更多问题

$f(n) = \log n$ is _____; $g(n) = 2n + 1$ is _____; $h(n) = f(n) + g(n)$ is _____.

A. $O(n); O(n); O(n)$
B. $\Omega(n); O(n^2); O(n)$
C. $O(n); \Omega(n^2); O(n)$

An algorithm has running time $T(n)$, which satisfies $T(n) \leq T(n/2) + c$ and $T(2) \leq c$.Then its running time is _____.

A. $O(n \log n)$
B. $O(n)$
C. $O(1)$
D. $O(\log n)$

A binary tree is a rooted tree in which each node has at most two children.What is the relation between the number of nodes with two children $ n_1 $ and thenumber of leaves (the nodes without children) $ n_2 $ in a binary tree?

A. $ 2n_1=n_2 $
B. $ n_1=n_2 $
C. $ n_1+1=n_2 $

In Mergesort algorithm, we divide the input into three pieces of equal size( replace two pieces); solve the three subproblems on these pieces separately by recursion; and then combine the three results into an overall solution, spending only linear time for the initial division and final recombining.Then, the running time of the above algorithm is _____.

A. $O(n^{\log_2 3} \log n)$
B. $O(n^2 \log n)$
C. $O(n^{\log_2 3})$
D. $O(n\log n)$

答案查题题库