Question: Problem 6 . ( 2 0 points ) During the annual balloon festival, Bob is trying to burst the most balloons with the least number
Problem points
During the annual balloon festival, Bob is trying to burst the most balloons with the
least number of arrows. The balloons are taped on a horizontal line, and each balloon
is represented by a closed interval along the axis. You are given an array of balloons
represented as intervals where each interval indicates the horizontal diameter
of the balloon. The goal is to determine the minimum number of arrows that must be shot
on the axis to burst all the balloons. An arrow can burst a balloon if it is shot within the
interval that represents that balloon. A single arrow will burst all balloons in its path.
For instance, consider the array of balloon interyals Bob can
burst all the balloons with just two arrows:
An arrow shot at will burst the balloons and
An arrow shot at will burst the balloons and
Given an array interval s of balloon intervals, design an algorithm MINARROWSintervals
in pseudocode that returns the minimum number of arrows required to burst all the bal
loons. Briefly explain your algorithm and state the time complexity in BigO notation. You
may call an external function SORT that sorts an array of intervals by their end
points in ascending order in time For full credit, your algorithm should have a
time complexity of where is the number of intervals; however, partial credit
will be given for slower solutions. Can someone explain the different elements that this code would need to have to receive full credit, and how BigO notation works
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
