menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Arrays: Fi...
source image

Prodevelopertutorial

1M

read

248

img
dot

Arrays: Find common element in 3 sorted arrays.

  • Given 3 sorted arrays, you need to find all the common elements in all the 3 elements.
  • The problem can be solved by finding the intersection of all the arrays.
  • Another optimized approach is to use a single loop to find the common elements.
  • The time complexity for both approaches is O(n1 + n2 + n3), where n1, n2, n3 are the sizes of the 3 arrays.

Read Full Article

like

14 Likes

For uninterrupted reading, download the app