1. Write a function that takes two arrays which are already ordered (in ascending order) and creates a new ordered array by merging these two arrays. Use ONLY queue functions for numeric arrays ("enqueue" or “dequeue") to do this! Note: In your code you are not allowed to use any of the sorting algorithms studied in this class. You will not get no point if you use them for this question!!!! Example: Input arrays: x = 1 3 4 8 11 y = 2 7 15 20 Output array: 1 2 3 4 7 8 11 15 20

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
ISE214-Spring2021 Assignment 4.pdf
Sayfa 2 / 4
Ara
ISE214-Spring2021 Assig...
ISECpimai Meed in leial agieing ping
Amiget
Dar a a
ela
YO SO ATTEPT O SOLVE ALL STONS OCTEAPASS ne EAFL
Ita ut
T CD A .s Y e
ATLAONINE nhat l N on he
1. Write a function that takes two arrays which are already ordered (in ascending order) and creates
a new ordered array by merging these two arrays. Use ONLY queue functions for numeric arrays
("enqueue" or “dequeue") to do this!
mE YORU LA T m A MENT.
4 pepl ingkr Ywillpos erwie
5 C ATIAMATLABO
z klasör 3
Note: In your code you are not allowed to use any of the sorting algorithms studied in this class.
You will not get no point if you use them for this question!!!!!
1
Example:
Input arrays:
1. Wia a nady ied ja dngni dcs
a ind a ygngt ys Lie ONLYura Íunti nk ags
Cun rgar dai
laete ty alan i des
Eple
27| 15 |
|+||4 || | |a
X =
ALSO TEST VOLR RNCTON WITH THE abe e diethe yer
ae ea et po MATLA MATLAR ONLINi nd e
yoer reer
NO SCREENSHKOT- ksfer weaig t
3
4
8 11
y =
2
7
15
20
i Ceidna priity whan amapl llmign ar
p pe a nanr d le
• der er e w ke lat gl s
wihinhe
An erole ofw deg penan worksen belo.
Empk:upo that th qammfr cnta te fekingemnt
Output array:
Duga patke trtrnmvetewnd am, the fent emr and lutr tethirt
l qd dwi laa MATLAR
ALSO TESE VOLR FLINCTION WETH THE par ab elde pur
aber nd ke hetpour MATLABor MATLAE ONLINE sen and inde
8 11
NO SCREENIOT kfe wea
1
2
3
4
7
15
MAY
10
étv A
W
280
O,
20
LO
Transcribed Image Text:ISE214-Spring2021 Assignment 4.pdf Sayfa 2 / 4 Ara ISE214-Spring2021 Assig... ISECpimai Meed in leial agieing ping Amiget Dar a a ela YO SO ATTEPT O SOLVE ALL STONS OCTEAPASS ne EAFL Ita ut T CD A .s Y e ATLAONINE nhat l N on he 1. Write a function that takes two arrays which are already ordered (in ascending order) and creates a new ordered array by merging these two arrays. Use ONLY queue functions for numeric arrays ("enqueue" or “dequeue") to do this! mE YORU LA T m A MENT. 4 pepl ingkr Ywillpos erwie 5 C ATIAMATLABO z klasör 3 Note: In your code you are not allowed to use any of the sorting algorithms studied in this class. You will not get no point if you use them for this question!!!!! 1 Example: Input arrays: 1. Wia a nady ied ja dngni dcs a ind a ygngt ys Lie ONLYura Íunti nk ags Cun rgar dai laete ty alan i des Eple 27| 15 | |+||4 || | |a X = ALSO TEST VOLR RNCTON WITH THE abe e diethe yer ae ea et po MATLA MATLAR ONLINi nd e yoer reer NO SCREENSHKOT- ksfer weaig t 3 4 8 11 y = 2 7 15 20 i Ceidna priity whan amapl llmign ar p pe a nanr d le • der er e w ke lat gl s wihinhe An erole ofw deg penan worksen belo. Empk:upo that th qammfr cnta te fekingemnt Output array: Duga patke trtrnmvetewnd am, the fent emr and lutr tethirt l qd dwi laa MATLAR ALSO TESE VOLR FLINCTION WETH THE par ab elde pur aber nd ke hetpour MATLABor MATLAE ONLINE sen and inde 8 11 NO SCREENIOT kfe wea 1 2 3 4 7 15 MAY 10 étv A W 280 O, 20 LO
ISE214-Spring2021 Assignment 4.pdf
Sayfa 3/ 4
Q Ara
ISE214-Spring2021 Assig...
tt To NCTO mT YALLt e e
OUTT OND AM TLA
HATLAS ONINE at ly C ND ON br e
2. Consider a priority queue which can hold arrays of different lengths. In this queue
ela
The
enqueue operation adds an array to the end of the queue,
dequeue operation removes the array which has the largest number among all arrays
within the queue.
Ad e y mmand wind mmple
4pe polfwwng n Ywilo po erwie
Cc eTo ATIA MATLAo
1
z klasör 3
An example of how dequeue operation works is given below.
1. Wa ma tnay h mady id ja dngnin) d
a nd an ygng ys Ler CNLYua fsmti nk ags
Example: Suppose that the queue currently contains the following elements
Note nyr de tme y ratingalanih iefin thir e
l at gt th
ple
Inpet am
Ourpetame
||2| |||a
ALSO TEST VOLR RNCTON WITH THE ak e e "p
abe ea et po MATLAR MATLAR ONLINi s nd iie
your
NOSCREENSOE- iiwhei t
n Resmi
5...11.59.01
1
8
3
12
3
-5
4
3
2
Dequeue operation firstly removes the second array, then the first array and lastly the third
array.
i Cemida priity whan amaf lmgn a
*pm e an ele
+ depar ea whahe lagi s
wie
An ple ofo deguopenaon worksgen belo.
Empk:upo that qu nfy cmtat te ong mnte
Implement this queue described above using cell arrays in MATLAB.
Dugueperation tty nemve tend amy. then the nt amr and lty tethint
dw i aa MATLAR
ALSO FESE VOLR FUNCTION WITH THE abrr he lhlr Or
abevel n eA ahat ur MATLARor MATLAE ONLINE wen d ine
your er
NO SCREEN OE ksfe wee aic t
ALSO TEST YOUR FUNCTION WITH THE “Input" above (the result should be the "Output"
above) and take a screenshot of your MATLAB or MATLAB ONLINE screen and include it in
your answer.
NO SCREENSHOT = 0 marks for this whole assignment!
MAY
10
étv
W
280
Transcribed Image Text:ISE214-Spring2021 Assignment 4.pdf Sayfa 3/ 4 Q Ara ISE214-Spring2021 Assig... tt To NCTO mT YALLt e e OUTT OND AM TLA HATLAS ONINE at ly C ND ON br e 2. Consider a priority queue which can hold arrays of different lengths. In this queue ela The enqueue operation adds an array to the end of the queue, dequeue operation removes the array which has the largest number among all arrays within the queue. Ad e y mmand wind mmple 4pe polfwwng n Ywilo po erwie Cc eTo ATIA MATLAo 1 z klasör 3 An example of how dequeue operation works is given below. 1. Wa ma tnay h mady id ja dngnin) d a nd an ygng ys Ler CNLYua fsmti nk ags Example: Suppose that the queue currently contains the following elements Note nyr de tme y ratingalanih iefin thir e l at gt th ple Inpet am Ourpetame ||2| |||a ALSO TEST VOLR RNCTON WITH THE ak e e "p abe ea et po MATLAR MATLAR ONLINi s nd iie your NOSCREENSOE- iiwhei t n Resmi 5...11.59.01 1 8 3 12 3 -5 4 3 2 Dequeue operation firstly removes the second array, then the first array and lastly the third array. i Cemida priity whan amaf lmgn a *pm e an ele + depar ea whahe lagi s wie An ple ofo deguopenaon worksgen belo. Empk:upo that qu nfy cmtat te ong mnte Implement this queue described above using cell arrays in MATLAB. Dugueperation tty nemve tend amy. then the nt amr and lty tethint dw i aa MATLAR ALSO FESE VOLR FUNCTION WITH THE abrr he lhlr Or abevel n eA ahat ur MATLARor MATLAE ONLINE wen d ine your er NO SCREEN OE ksfe wee aic t ALSO TEST YOUR FUNCTION WITH THE “Input" above (the result should be the "Output" above) and take a screenshot of your MATLAB or MATLAB ONLINE screen and include it in your answer. NO SCREENSHOT = 0 marks for this whole assignment! MAY 10 étv W 280
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY