IT206: Design and Analysis of Algorithms
You are asked to design an algorithm to optimize profit on a stock X. The following is how the stock has been doing for the last 10 days:
Day 1: $143;
Day 2: $122;
Day 3: $121;
Day 4: $119;
Day 5: $147;
Day 6: $170;
Day 7: $172;
Day 8: $180;
Day 9: $170;
Day 10: $161.
Your algorithm should:
a) find the lowest price to buy and the highest price to sell.
b) make the buying date before the selling date
Hint: To make the algorithm more effective you may create two arrays or lists instead of one.
You are required to make at least two comments on the responses posted by you classmates with a minimum of 50 words. Make sure you design your response with your own words. Your responses to your classmates must be of substance; not just “I agree” or “Good Post.” The purpose of the responses is to convert the discussion forum into a quality academic environment through which you improve your knowledge and understanding. Read and review all assigned course materials and chapters before you start working on your assignments.
- 12 days ago
- 9
Purchase the answer to view it
- Algebraberhanuw.docx
- Algebraberhanuw.pdf
- Dr Michelle Maya
- Musyokiones
- Tutor Cyrus Ken
- Dr. Michelle_KM
- RihAN_Mendoza
- Emily Clare
- ProCastrol01
- Dr. Diana_Ashley
- Premium
- Creative Geek
- juliusmu33
- Prof Double R
- PROF_TOMMY
- Michelle GoodMan
- HomeMarket_Tutor
- American Tutor
- Teachermulandy
- brilliant answers
- WIZARD_KIM
- Jah Provides
- Abdullah Anwar
- Cotton Candy
- prof bradley
- Noor427726
- Nightingale
- Elprofessori
- quality work for all
- Dr shamille Clara
- HOMWORK_WRITER
- bennetsandova
- Emily Michael
- Paula Hog
- PROF. ANN
- Dr Ava_Mia
- Agher Editor
- perfecto
- Catherine Owens
- Eva Green
- Jessica Luis
- suraya_PhD
- Urgent Tutor
- Sasha Spencer
- Brilliant Geek
- STANWRITTER
- ChrisProf
- Stano 001
- EssaySupremo
- Rima Makenzie
- Ultimate GEEK
- RELIABLE PAPERS
- Terry Roberts
- Clytemnestra
- Jamie Acker
- Coleen Anderson
- prof avril
- ConsultThanos
- Dr Candice_2547
- Prof Hangoi
- wizard kim
- Amanda Smith
- Proff work phd
- Goodwriter
- Miss Professor
- DrNicNgao
- Nursing_Miss
- Angelina May
- TheKingWriter
- MISS MLUCK
- Wendy Lewis
- Rey writer
- Quality_Ans
- ansRohan
- DexterMasters
- Tutor-Cahun
- GuruFocusWriter
- GradeSaver
- brainiack
- Essay-Shark-JW25
- kim woods
- Rose Wilson
- university work
- Ranchoddas Chanchad PhD
- michael smith
- PROFJUMAAA
- Prof. X
- johnmutuajm
- Sally Sutton
- smart-tutor
- A+SolutionsQueen
- dr.johesta
- Mark Lewis
- Tom Kirk
- Octavial
- [email protected]
- Charandary Sec
- VARSITY TUTOR
- ontime papers
- M001-Miss
- Seasoned Helper