×

# GEEK01 - Editorial

Practice

Contest

Author: Bhuvnesh Jain

Tester: Bhuvnesh Jain

Editorialist: Bhuvnesh Jain

CAKEWALK

# Prerequisites

Sorting, Looping Techniques

# Problem

The median of a matrix is defined as the median of the median of all rows. Find the median of the matrix.

# Explanation

To find the median, we need the numbers to be sorted in increasing order. To sort the numbers, we can use merge sort or inbuilt sort algorithm available in the languages. Once, we find the median of all rows, we can do the same trick to find the median of all rows.

# Time Complexity

$O(N * N * \log{N})$, per test case.

# Space Complexity

$O(N * N)$

Setter's solution

6★likecs
3.7k2380
accept rate: 9%

19.8k350498541

 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×15,683
×1,652
×790
×593
×4

question asked: 20 Nov '17, 22:01

question was seen: 301 times

last updated: 26 Nov '17, 16:35