Array - 21: Intersection of two Sorted array | Find common elements of two sorted arrays

preview_player
Показать описание
Solution:
- One by one we'll compare both array values from starting
- If both array value is same, then, put any array value in new array or list & increase both indexes(i, j)
- Time Complexity: O(n + m) for iterating the both array, where m - first array length, m - second array length

Please check video for more info:

This problem is similar to:
how to do intersection of two sorted array,
Find common elements of two sorted arrays,
intersection of two sorted arrays,
print intersection of two sorted array,
intersection,
two sorted array,
array,
java tutorial,
coding simplified,
java

CHECK OUT CODING SIMPLIFIED

I started my YouTube channel, Coding Simplified, during Dec of 2015.
Since then, I've published over 300+ videos. My account is Partner Verified.

★☆★ VIEW THE BLOG POST: ★☆★

★☆★ SUBSCRIBE TO ME ON YOUTUBE: ★☆★

★☆★ SEND EMAIL At: ★☆★
Рекомендации по теме
Комментарии
Автор

Seriously man keep doing the good work.

shubham
Автор

Space complexity?? as u taking list of finalIntersectionArray in driver code

anjalisingh-sxct
Автор

I think time complexity is O(n) st n is smaller of either two lenghts i. e; length of array 1 or array 2

ashiqhussainkumar