time-complexity
tricky linked list problem
Given three lists: A, B and C of length n each. if any 3 three numbers (1 from each list), sum up to zero return true.I want t开发者_StackOverflow中文版o solve this with o(n)complexity.I have sorted t[详细]
2023-02-18 21:22 分类:问答Time complexity of a stack-based tree traversal
What is the time complexity of the implementation of a binary tree traversal below? void Tree::nonRecInOrder()[详细]
2023-02-17 18:30 分类:问答Search algorithm and its complexity
I was asked this question in an interview: Assume an infinite array of integers which is sorted. How would you search for an integer in this array? What would be time complexity?[详细]
2023-02-17 10:14 分类:问答Time complexity of power() [duplicate]
This question already has answers here: The most effi开发者_运维百科cient way to implement an integer based power function pow(int, int)[详细]
2023-02-15 06:51 分类:问答What is an example of an algorithm with complexity of O(n^5)?
can anyone provide an example of an algorithm with minimal running time complexity of O(n^5)?开发者_StackOverflow中文版O n5 volume algorithm for complex bodies.[详细]
2023-02-14 04:02 分类:问答Recursive toString() method in a binary search tree. What is the time complexity for this?
I\'m a beginner in Java and looking for some help. So I\'ve made this binary tree in Java, and I\'m supposed to implement a method which sorts all elements开发者_如何学JAVA in order and convert them[详细]
2023-02-11 14:30 分类:问答Complexity of external merge sort
What is the complexity of a 2 phase multi-wa开发者_JS百科y external sort using quick sort (nlogn) as internal sort.Not an expert here but...[详细]
2023-02-11 08:06 分类:问答What is a data structure that supports fast next-higher-element and next-lower-element?
Specifically I want O(log n) insertion/deletion times and O(1) operation for find_next_higher_element which given an element in the data structure returns the element just greater than it in constant[详细]
2023-02-10 09:08 分类:问答What is the time complexity of tree traversal?
What is the time complexity of tree traversal, I\'m sure 开发者_如何学编程it must be obvious but my poor brain can not work it out right now.It depends what kind of traversal you are performing and th[详细]
2023-02-09 22:23 分类:问答Avgerage Time Complexity of a sorting algorithm
I have a treesort function which performs two distinct tasks, each with its own time complexity. I figured out the avg. case time complexity of the two tasks but how do I find the overall complexity o[详细]
2023-02-09 15:37 分类:问答