SlideShare a Scribd company logo
Language is C++
** Using Dynamic Memory 1 **
One statistic of interest to many researchers is the median of a set of data. The median is the
value in the middle. (This is NOT the average.) Being in the middle implies that the data are in
order (sorted). If there are an odd number of data items, the middle is simple to find. If there are
an even number of data items, you take the average of the two middle values.
** Task **
Find the median of a set of data from a text file of unknown length.
1. You need to count the number of items
2. Sort the data (you can use the stl sort function here)
3. Find the median
4. Output the median
** Restrictions **
1. You must use dynamic memory to store the data
2. You must use as little memory as possible
3. DO NOT use #include<bits/stdc++.h> library
Thanks a lot in advance for your help!

More Related Content

PDF
Educational Objectives After successfully completing this assignmen.pdf
PDF
c++ code for a Median of Integer Stream from Text File program#.pdf
PDF
Please help. C++ The program is an interactive program th.pdf
PPTX
Linear Search Data Structure
PPT
Vectors Intro.ppt
DOC
Comp 122 lab 6 lab report and source code
PPT
1 class linear and Binary search (3).ppt
PPTX
Introduction_to_Cpp_with_Images_and_Activity.pptx
Educational Objectives After successfully completing this assignmen.pdf
c++ code for a Median of Integer Stream from Text File program#.pdf
Please help. C++ The program is an interactive program th.pdf
Linear Search Data Structure
Vectors Intro.ppt
Comp 122 lab 6 lab report and source code
1 class linear and Binary search (3).ppt
Introduction_to_Cpp_with_Images_and_Activity.pptx

Similar to Language is C++ -- Using Dynamic Memory 1 -- One statistic of interest.pdf (20)

PDF
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdf
PDF
05_Arrays C plus Programming language22.pdf
PDF
#include iostream #includeData.h #includePerson.h#in.pdf
PDF
Dynamic C++ Silicon Valley Code Camp 2012
PPTX
FSTREAM,ASSERT LIBRARY & CTYPE LIBRARY.
PDF
Acm aleppo cpc training ninth session
PPTX
Median
PDF
c++ referesher 1.pdf
PDF
Using c++Im also using a the ide editor called CodeLiteThe hea.pdf
PPT
lecture7.ppt
PPT
its arrays ppt for first year students .
DOC
programming in C++ report
DOCX
Type header file in c++ and its function
PDF
Acm aleppo cpc training second session
DOCX
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
PDF
Amcat automata questions
PDF
Amcat automata questions
PPT
Templates exception handling
PDF
Pointers in real life
PPT
10.ppt
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdf
05_Arrays C plus Programming language22.pdf
#include iostream #includeData.h #includePerson.h#in.pdf
Dynamic C++ Silicon Valley Code Camp 2012
FSTREAM,ASSERT LIBRARY & CTYPE LIBRARY.
Acm aleppo cpc training ninth session
Median
c++ referesher 1.pdf
Using c++Im also using a the ide editor called CodeLiteThe hea.pdf
lecture7.ppt
its arrays ppt for first year students .
programming in C++ report
Type header file in c++ and its function
Acm aleppo cpc training second session
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
Amcat automata questions
Amcat automata questions
Templates exception handling
Pointers in real life
10.ppt

More from atozfancystore1996 (20)

PDF
Let's discuss bioinformatics- How powerful is it- Are we living our li.pdf
PDF
Let {N(t)-t0} be a Poisson process with rate - Calculate E-N(t)N(t+s)-.pdf
PDF
Let's assume you do replica plating experiment where you treat WT bact.pdf
PDF
let X1- X2- - - - - Xn uniform -0-1-- i-e- independent identically dis.pdf
PDF
Let Xn denote a Binomial random variable with parameters (n-pn)-n1- If.pdf
PDF
Let X1-X2 be i-i-d- N(-1) random variables with unknown parameter R- (.pdf
PDF
Let Y be a random variable with p(y) given in the accompanying table- (1).pdf
PDF
Let Y1- Y2- - - - - Yn be a random sample from a population with densi.pdf
PDF
Let X1 and X2 be independent Poisson random variables with means 1 and.pdf
PDF
Let X have a uniform distribution on the interval (4-7)- Find the prob.pdf
PDF
Let X be a normal random variable with mean 199 units and standard dev.pdf
PDF
Let X be a discrete random variable following a binomial distribution.pdf
PDF
Let (x) be the number of primes that are x- Show that (x) is primitive.pdf
PDF
Let X be a continuous random variable with probability density functio.pdf
PDF
Let X and Y be two discrete random variables with joint mass function.pdf
PDF
Let X be a continuous random variable with cumulative distribution fun.pdf
PDF
Let P-{P-} a family of distributions on (X-B) (i) Show that P is not a.pdf
PDF
Let P be the total number of professors and let C be the number of pro.pdf
PDF
Let E and F be two events that are mutually exclusive with P(E)-0-1 an.pdf
PDF
Leo earns $160-000 per year for the last several years- He retires in.pdf
Let's discuss bioinformatics- How powerful is it- Are we living our li.pdf
Let {N(t)-t0} be a Poisson process with rate - Calculate E-N(t)N(t+s)-.pdf
Let's assume you do replica plating experiment where you treat WT bact.pdf
let X1- X2- - - - - Xn uniform -0-1-- i-e- independent identically dis.pdf
Let Xn denote a Binomial random variable with parameters (n-pn)-n1- If.pdf
Let X1-X2 be i-i-d- N(-1) random variables with unknown parameter R- (.pdf
Let Y be a random variable with p(y) given in the accompanying table- (1).pdf
Let Y1- Y2- - - - - Yn be a random sample from a population with densi.pdf
Let X1 and X2 be independent Poisson random variables with means 1 and.pdf
Let X have a uniform distribution on the interval (4-7)- Find the prob.pdf
Let X be a normal random variable with mean 199 units and standard dev.pdf
Let X be a discrete random variable following a binomial distribution.pdf
Let (x) be the number of primes that are x- Show that (x) is primitive.pdf
Let X be a continuous random variable with probability density functio.pdf
Let X and Y be two discrete random variables with joint mass function.pdf
Let X be a continuous random variable with cumulative distribution fun.pdf
Let P-{P-} a family of distributions on (X-B) (i) Show that P is not a.pdf
Let P be the total number of professors and let C be the number of pro.pdf
Let E and F be two events that are mutually exclusive with P(E)-0-1 an.pdf
Leo earns $160-000 per year for the last several years- He retires in.pdf

Recently uploaded (20)

PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
Virtual and Augmented Reality in Current Scenario
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
Empowerment Technology for Senior High School Guide
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
Indian roads congress 037 - 2012 Flexible pavement
PDF
Computing-Curriculum for Schools in Ghana
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
HVAC Specification 2024 according to central public works department
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PDF
Hazard Identification & Risk Assessment .pdf
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PPTX
Introduction to pro and eukaryotes and differences.pptx
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Virtual and Augmented Reality in Current Scenario
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
Empowerment Technology for Senior High School Guide
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Indian roads congress 037 - 2012 Flexible pavement
Computing-Curriculum for Schools in Ghana
202450812 BayCHI UCSC-SV 20250812 v17.pptx
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
HVAC Specification 2024 according to central public works department
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Hazard Identification & Risk Assessment .pdf
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
Unit 4 Computer Architecture Multicore Processor.pptx
Introduction to pro and eukaryotes and differences.pptx
A powerpoint presentation on the Revised K-10 Science Shaping Paper
AI-driven educational solutions for real-life interventions in the Philippine...
LDMMIA Reiki Yoga Finals Review Spring Summer
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
FORM 1 BIOLOGY MIND MAPS and their schemes

Language is C++ -- Using Dynamic Memory 1 -- One statistic of interest.pdf

  • 1. Language is C++ ** Using Dynamic Memory 1 ** One statistic of interest to many researchers is the median of a set of data. The median is the value in the middle. (This is NOT the average.) Being in the middle implies that the data are in order (sorted). If there are an odd number of data items, the middle is simple to find. If there are an even number of data items, you take the average of the two middle values. ** Task ** Find the median of a set of data from a text file of unknown length. 1. You need to count the number of items 2. Sort the data (you can use the stl sort function here) 3. Find the median 4. Output the median ** Restrictions ** 1. You must use dynamic memory to store the data 2. You must use as little memory as possible 3. DO NOT use #include<bits/stdc++.h> library Thanks a lot in advance for your help!