c. g.enqueue (arr[4]); 9.enqueue (arr[5]); d. What is the output of the following statements? System.out.println(g.size()); System.out.println(g.first()); e. Explain what will happen after executing the following statement. g.enqueue (arr[6]); f. What is the performance (in Big-O notation) of each of the previous methods? Explain.

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

please use id:202010043 and id:202010387

W
AutoSave
Off H
ITCS 224 Final Exam.docx -
P Search (Alt+Q)
MARAH RAED SABAH ALSALOOM
File
Home
Insert
Draw Design Layout References Mailings
Review
View
Help
Table Design Layout
O Comments
E Share
Calibri
v 14
三、行
BIUv ab x, x A
Styles Editing Dictate Sensitivity
Paste
Editor
Reuse
A.
Aa v A A
Files
Undo
Clipboard a
Font
Paragraph
5 Styles
Voice
Sensitivity
Editor Reuse Files
Question 5 (1 x 12 = 12 marks)
Consider your ID as an array of 9 elements. Example ID: 201710340
arr
2
7
1
3
4
Consider a Linear Queue implemented using an array of length 6. Show the contents of the queue
after executing each of the following segments of code in order.
a. g.enqueue(arr[0]);
9. enqueue (arr[1]);
9. enqueue (arr[2]);
g. enqueue (arr[3]);
q
b. g. dequeue ();
g.dequeue ();
Page 5 of 5 935 words E English (United Kingdom)
* Accessibility: Investigate
D Focus
100%
12:31 PM
P Type here to search
G D T ENG
W
89°F
5/17/2022
Transcribed Image Text:W AutoSave Off H ITCS 224 Final Exam.docx - P Search (Alt+Q) MARAH RAED SABAH ALSALOOM File Home Insert Draw Design Layout References Mailings Review View Help Table Design Layout O Comments E Share Calibri v 14 三、行 BIUv ab x, x A Styles Editing Dictate Sensitivity Paste Editor Reuse A. Aa v A A Files Undo Clipboard a Font Paragraph 5 Styles Voice Sensitivity Editor Reuse Files Question 5 (1 x 12 = 12 marks) Consider your ID as an array of 9 elements. Example ID: 201710340 arr 2 7 1 3 4 Consider a Linear Queue implemented using an array of length 6. Show the contents of the queue after executing each of the following segments of code in order. a. g.enqueue(arr[0]); 9. enqueue (arr[1]); 9. enqueue (arr[2]); g. enqueue (arr[3]); q b. g. dequeue (); g.dequeue (); Page 5 of 5 935 words E English (United Kingdom) * Accessibility: Investigate D Focus 100% 12:31 PM P Type here to search G D T ENG W 89°F 5/17/2022
W
AutoSave
Off H
ITCS 224 Final Exam.docx -
P Search (Alt+Q)
MARAH RAED SABAH ALSALOOM
File
Home
Insert
Draw Design Layout References Mailings
Review
View
Help Table Design Layout
O Comments
E Share
三、
そ= →三
Calibri
v 14
v ab x, x A
Styles
Editing Dictate Sensitivity
Paste
Editor
Reuse
A • Aa v A^ A
Files
Undo
Clipboard a
Paragraph
E Styles a
Sensitivity
Font
Voice
Editor Reuse Files
レ ノ
%3B
g.dequeue ();
c. g.enqueue(arr[4]);
9.enqueue (arr[5]);
d. What is the output of the following statements?
System.out.println(g.size(O);
System.out.println(a.first());
e. Explain what will happen after executing the following statement.
9.enqueue (arr[6]);
f. What is the performance (in Big-O notation) of each of the previous methods? Explain.
Page 5 of 5 935 words E English (United Kingdom)
* Accessibility: Investigate
O Focus
100%
12:31 PM
P Type here to search
G D T ENG
W
89°F
5/17/2022
Transcribed Image Text:W AutoSave Off H ITCS 224 Final Exam.docx - P Search (Alt+Q) MARAH RAED SABAH ALSALOOM File Home Insert Draw Design Layout References Mailings Review View Help Table Design Layout O Comments E Share 三、 そ= →三 Calibri v 14 v ab x, x A Styles Editing Dictate Sensitivity Paste Editor Reuse A • Aa v A^ A Files Undo Clipboard a Paragraph E Styles a Sensitivity Font Voice Editor Reuse Files レ ノ %3B g.dequeue (); c. g.enqueue(arr[4]); 9.enqueue (arr[5]); d. What is the output of the following statements? System.out.println(g.size(O); System.out.println(a.first()); e. Explain what will happen after executing the following statement. 9.enqueue (arr[6]); f. What is the performance (in Big-O notation) of each of the previous methods? Explain. Page 5 of 5 935 words E English (United Kingdom) * Accessibility: Investigate O Focus 100% 12:31 PM P Type here to search G D T ENG W 89°F 5/17/2022
Expert Solution
steps

Step by step

Solved in 2 steps

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