All Questions
Tagged with dynamic-programming array
3 questions
1
vote
1
answer
1k
views
Merging algorithm for overlapping intervals
I have been searching for an efficient algorithm to merge overlapping intervals on a dynamic array of intervals. For example, (start time, end time) wise,
[(1, 2), (4, 8), (3, 10)]
becomes
[(1, 2)...
0
votes
1
answer
3k
views
find longest subsequence with sum less than or equal to k
I have a vector<int> num, I want to get the size of longest subarray with the sum less than or equal to k.
My approach:
O(n^2). Repeat for every element in the array.
Can we do better?'
...
-2
votes
4
answers
2k
views
C simple arrays and pointers question
So here's the confusion, let's say I declare an array of characters
char name[3] = "Sam";
and then I declare another array but this time using pointers
char * name = "Sam";
What's the difference ...