Find Common Elements in Three Sorted Arrays - Java Code

Find Common Elements in Three Sorted Arrays - Java Code

Programming Tutorials

5 лет назад

30,488 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@ashwiniv7053
@ashwiniv7053 - 08.08.2019 01:26

very well explained.

Ответить
@simonsmith4706
@simonsmith4706 - 03.03.2023 17:26

Using HashSet is very smart here

Ответить
@sanket7897
@sanket7897 - 13.07.2022 11:40

What if array is not sorted.. Then which approach will you use

Ответить
@Liv_Life
@Liv_Life - 03.08.2021 07:56

This program will not pass all cases it consists of so many bugs

Ответить
@abhibhagat7767
@abhibhagat7767 - 29.07.2020 13:32

Nice video but one minor correction: You should state explicitly that your first O(m+n) solution works ONLY for sorted arrays. The failing test case is [6,1,2,3] and [1,2,3]. Your second O(m+n) solution works for both types of arrays obviously.

Ответить
@mohitkatyal3330
@mohitkatyal3330 - 03.03.2020 21:23

how do we ignore repeated number for eg arr1=[1,2,3,4,5] arr2=[1,1,2,2,3] output= 1,1,2,2 but desired output =[1,2]

Ответить
@3Mrdeep
@3Mrdeep - 13.02.2020 03:44

What if the 2nd array contains 2 values which are same. It would be printed 2 times which is wrong

Ответить
@ganeshc3157
@ganeshc3157 - 11.10.2019 21:50

same as two array of tunion example can you explain sir

Ответить
@raminanushiravani9524
@raminanushiravani9524 - 06.03.2019 11:07

You're finding common elements, this is not intersection.

Ответить
@ad_cy6303
@ad_cy6303 - 19.02.2019 13:52

Can u pls tell me the platform u r using sir or the software

Ответить
@ProgrammingTutorials1M
@ProgrammingTutorials1M - 08.11.2018 03:35

Code link is present in the description box.

Ответить
@Amitkumar-ly9zl
@Amitkumar-ly9zl - 12.06.2018 04:47

The way you have explained two approaches to solve this problem is awesome.

Ответить