Computer Science: An Overview: Global Edition (12th Edition)

Published by Pearson Higher Education
ISBN 10: 1292061162
ISBN 13: 978-1-29206-116-0

Chapter 12 - Theory of Computation - Chapter Review Problems - Page 571: 26

Answer

Yes

Work Step by Step

A polynomial problem is one that can be solved in polynomial time with respect to the size of the input (usually denoted as $n$). Binary Tree Search Complexity: In a general binary tree (not necessarily balanced or ordered), searching for a value requires visiting each node in the worst case. If there are $n$ nodes, the worst-case time complexity is $O(n)$. $O(n)$ is a linear time complexity, which is a subset of polynomial time $(O(n^k)$ for some constant $k$). Special Case: Binary Search Tree (BST): If the binary tree is a binary search tree and balanced, search can be done in $O(\log n)$ time. $O(\log n)$ is even better than polynomial time. Conclusion Searching through a finite binary tree for a particular value is a polynomial problem because its worst-case time complexity is $O(n)$, which is polynomial in the size of the input.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.