Problem Solving for Developers – JavaScript [Arrays, Searching].

Hey everyone,
I’m Dreamy and today we’re gonna solve a problem in JavaScript.

And today’s type of Problem is – Arrays and Searching.

/**
* Given two sorted arrays array1 and array2 of size m and n respectively.
* Find the median of the two sorte…


This content originally appeared on DEV Community and was authored by Dreamy Developer

Hey everyone,
I'm Dreamy and today we're gonna solve a problem in JavaScript.

And today's type of Problem is - Arrays and Searching.

/**
 * Given two sorted arrays array1 and array2 of size m and n respectively.
 * Find the median of the two sorted arrays.
 *
 * @Example 1:
 * Input:
 * m = 3, n = 4
 * array1 = [1, 9, 15]
 * array2 = [2, 4, 5, 23]
 *
 * Output: 5
 *
 * @Example 2:
 * Input:
 * m = 2, n = 4
 * array1 = [41, 78]
 * array2 = [3, 4, 7, 8]
 *
 * Output: 7.5
 *
 * Expected Time Complexity: O(min(log n, log m)).
 * Expected Auxiliary Space: O((n+m)/2).
 */

Have a bit of a coding yourself and see what kind of solution you can come up with and comment your solution here.
You can write your solution in any language and in your way, But don't forget to comment your best solution here.

If you get stuck or you want to see the solution,
II'l show you how would i solve it.

We will Highlight top answers || comments in Future videos.

highlighted Comments showing 40% responded "Yes", 50% responded "No" and 10% responded "Not sure"

Check the tutorial for Solution

https://youtu.be/crflWrWDwcA


This content originally appeared on DEV Community and was authored by Dreamy Developer


Print Share Comment Cite Upload Translate Updates
APA

Dreamy Developer | Sciencx (2022-02-05T07:15:04+00:00) Problem Solving for Developers – JavaScript [Arrays, Searching].. Retrieved from https://www.scien.cx/2022/02/05/problem-solving-for-developers-javascript-arrays-searching/

MLA
" » Problem Solving for Developers – JavaScript [Arrays, Searching].." Dreamy Developer | Sciencx - Saturday February 5, 2022, https://www.scien.cx/2022/02/05/problem-solving-for-developers-javascript-arrays-searching/
HARVARD
Dreamy Developer | Sciencx Saturday February 5, 2022 » Problem Solving for Developers – JavaScript [Arrays, Searching].., viewed ,<https://www.scien.cx/2022/02/05/problem-solving-for-developers-javascript-arrays-searching/>
VANCOUVER
Dreamy Developer | Sciencx - » Problem Solving for Developers – JavaScript [Arrays, Searching].. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/02/05/problem-solving-for-developers-javascript-arrays-searching/
CHICAGO
" » Problem Solving for Developers – JavaScript [Arrays, Searching].." Dreamy Developer | Sciencx - Accessed . https://www.scien.cx/2022/02/05/problem-solving-for-developers-javascript-arrays-searching/
IEEE
" » Problem Solving for Developers – JavaScript [Arrays, Searching].." Dreamy Developer | Sciencx [Online]. Available: https://www.scien.cx/2022/02/05/problem-solving-for-developers-javascript-arrays-searching/. [Accessed: ]
rf:citation
» Problem Solving for Developers – JavaScript [Arrays, Searching]. | Dreamy Developer | Sciencx | https://www.scien.cx/2022/02/05/problem-solving-for-developers-javascript-arrays-searching/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.