Here are the answers to your questions:
c) Given the right upper bound for the algorithm with the time upper bound functions. Use Big-O Notation for your answers?
- i) n3+3n−1
The highest order term is n3.
O(n3)
- ii) 2n⋅logn
The highest order term is nlogn. Constant factors are ignored.
O(nlogn)
- iii) 3⋅n20
The highest order term is n20. Constant factors are ignored.
O(n20)
d) Define intractable problem with and example?
An intractable problem is a computational problem for which no efficient algorithm exists that can solve it in polynomial time. This means that as the input size grows, the time required to solve the problem increases exponentially, making it practically impossible to solve for large inputs within a reasonable timeframe.
Example: The Traveling Salesperson Problem (TSP) is a classic example. Given a list of cities and the distances between each pair of cities, the problem is to find the shortest possible route that visits each city exactly once and returns to the origin city. The number of possible routes grows factorially with the number of cities, making it intractable for a large number of cities.
That's 2 down. 3 left today — send the next one.