Find the median of a set of sorted lists, Computer Science

Click For Summary
SUMMARY

The discussion focuses on devising a divide and conquer algorithm to efficiently find the median of a set of sorted lists, specifically avoiding O(n^2) and probabilistic runtimes. The proposed approach involves sorting the lists by their median values, dividing them into lower and upper halves, and then refining these subsets based on their median points. The challenge lies in maintaining efficiency without merging the lists, which could lead to increased runtime complexity.

PREREQUISITES
  • Understanding of divide and conquer algorithms
  • Familiarity with median finding techniques in sorted arrays
  • Knowledge of time complexity analysis, particularly O(log(n)) and O(n)
  • Experience with data structures that support efficient median retrieval
NEXT STEPS
  • Research advanced divide and conquer algorithms for median finding
  • Study the implementation of median finding in sorted arrays using binary search
  • Explore data structures like balanced binary search trees for efficient median operations
  • Learn about the implications of runtime complexity in algorithm design
USEFUL FOR

Computer science students, algorithm designers, and software engineers focusing on optimization techniques for median finding in sorted datasets.

chy1013m1
Messages
14
Reaction score
0

Homework Statement


Given a set of sorted lists {X1, X2, ..., Xn} each Xi is in R^n , devise a divide and conquer algo that
finds the median of X1\bigcup X2 \bigcup ... \bigcup Xn efficiently.
(n * log(n), n^2 is not acceptable, also no probabilistic, expected runtime)
Also, Xi \bigcap Xj = \phi \forall i, j s.t. i\neqj

Homework Equations


already know a procedure that finds the median of 2 equal sized, sorted lists in O(log(n)) time

The Attempt at a Solution


- sort the lists by its median values, re-label them to be X1, X2..., Xn
- divide the lists into L = {X1, ..., X[floor(n/2)]} and U = {X_ceil(n/2) ... , Xn}
- find the med points of L, call it "ml", and the med point of U, call it "mu"
- remove elements < ml from L, elements > mu from U, get new set of L', and U'.
but at this point, the lists could be no equal in size, if we do a merge it could blow up the runtime,
since merge is theta(n)
 
Last edited:
Physics news on Phys.org
X is list ; M is median ; r is # of elements less than M.
X1 : (M1,r1)
X2 : (M2,r2)
X3 : (M3,r3)
..
Xn : (Mn,rn)

^
larger r's
r
r x x
r x x xx x
r x x x xx x x
r xxx xxx xx x x x
r xxx xxx xxxxxx x
m_m_m_m_m_mm___m___> larger medians

can you notice anything about that data?
 
Last edited:

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
18
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 9 ·
Replies
9
Views
5K