i am not getting how to take input for n arrays,can u tell logic of the problem too
Activity selection problem doubt
@kadaparaghavendra1 you can take input in this question and store it in array of pairs as for every value you have two inputs. and for the logic refer this its very well explained
https://www.geeksforgeeks.org/activity-selection-problem-greedy-algo-1/ (this)
i hope its clear if yes dont forget to hit like and mark resolved otherwise ask me
by using sort function,can we sort the 2d array according to their finishing times,can u send the code by using sort function
@kadaparaghavendra1 using sort we can sort the array of pair according to ending (second element)
you can do that easily by comparator. do you want me to send the code for this part?
yeah…i need code of sorting a 2d array using a comparator
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.