It's UWAweek 50

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying the 8 articles in this topic
Showing 8 of 834 articles.
Currently 2 other people reading this forum.


 UWA week 42 (2nd semester, week 12) ↓
SVG not supported

Login to reply

👍?
helpful
5:55pm Tue 15th Oct, ANONYMOUS

Hi, before I accidentally posted these in someone elses article so I'll post it here instead: I would like to see if these test outputs are correct: in.txt: 0 0 0 0 0 1 1 0 0 0 1 1 2 3 3 2 1 2 out.txt: 99, 99, 2, 3 4, 5, 6, 7 99, 99, 0, 99 99, 1, 99, 99 2,2,17; 2,2,17; 3,1,14; 3,1,14; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,5; 1,0,5; 1,1,6; 1,1,6; 1,2,10; 1,2,10; 1,3,11; 1,3,11; in.txt: 0 0 0 0 0 1 1 2 2 3 3 2 2 1 1 out.txt: 99, 1, 2, 3 99, 99, 4, 5 99, 99, 6, 7 99, 0, 99, 99 3,1,10; 3,1,10; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,2,13; 1,2,13; 1,3,14; 1,3,14; 2,2,11; 2,2,11; 2,3,12; 2,3,12; int.txt: 0 0 0 0 1 0 0 2 3 1 0 2 3 3 2 out.txt: 0, 1, 2, 3 4, 7, 99, 99 99, 99, 5, 99 99, 99, 6, 99 0,0,0; 0,0,0; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,14; 2,2,14; 3,2,13; 3,2,13; 1,1,9; 1,1,9;


SVG not supported

Login to reply

👍?
helpful
6:21pm Tue 15th Oct, ANONYMOUS

ANONYMOUS wrote:
> Hi, before I accidentally posted these in someone elses article so I'll post it here instead: I would like to see if these test outputs are correct: > > > > in.txt: 0 0 0 0 0 1 1 0 0 0 1 1 2 3 3 2 1 2 > > out.txt: > > 99, 99, 2, 3 > 4, 5, 6, 7 > 99, 99, 0, 99 > 99, 1, 99, 99 > 2,2,17; 2,2,17; 3,1,14; 3,1,14; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,5; 1,0,5; 1,1,6; 1,1,6; 1,2,10; 1,2,10; 1,3,11; 1,3,11; > > > > in.txt: 0 0 0 0 0 1 1 2 2 3 3 2 2 1 1 > > out.txt: > > 99, 1, 2, 3 > 99, 99, 4, 5 > 99, 99, 6, 7 > 99, 0, 99, 99 > 3,1,10; 3,1,10; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,2,13; 1,2,13; 1,3,14; 1,3,14; 2,2,11; 2,2,11; 2,3,12; 2,3,12; > > > > int.txt: 0 0 0 0 1 0 0 2 3 1 0 2 3 3 2 > > out.txt: > > 0, 1, 2, 3 > 4, 7, 99, 99 > 99, 99, 5, 99 > 99, 99, 6, 99 > 0,0,0; 0,0,0; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,14; 2,2,14; 3,2,13; 3,2,13; 1,1,9; 1,1,9;
These are correct. C Clarification for if anyone else looks at this. OP has decided to ignore calls if all has been loaded. It would look different if you chose to load it again.


SVG not supported

Login to reply

👍?
helpful
6:38pm Tue 15th Oct, ANONYMOUS

ANONYMOUS wrote:
> Clarification for if anyone else looks at this. OP has decided to ignore calls if all has been loaded. It would look different if you chose to load it again.
This is what the inputs and outputs would look like for anyone loading pages again: in.txt 0 0 0 0 0 1 1 0 0 0 1 1 2 3 3 2 1 2 out.txt 99, 1, 2, 3 5, 99, 6, 7 99, 99, 0, 99 99, 4, 99, 99 2,2,17; 2,2,17; 0,1,7; 0,1,7; 0,2,8; 0,2,8; 0,3,9; 0,3,9; 3,1,14; 3,1,14; 1,0,16; 1,0,16; 1,2,10; 1,2,10; 1,3,11; 1,3,11 in.txt 0 0 0 0 0 1 1 2 2 3 3 2 2 1 1 out.txt 0, 99, 2, 3 99, 99, 4, 5 99, 99, 6, 7 99, 1, 99, 99 0,0,4; 0,0,4; 3,1,10; 3,1,10; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,2,13; 1,2,13; 1,3,14; 1,3,14; 2,2,11; 2,2,11; 2,3,12; 2,3,12 in.txt 0 0 0 0 1 0 0 2 3 1 0 2 3 3 2 out.txt 0, 1, 2, 3 4, 7, 99, 99 99, 99, 5, 99 99, 99, 6, 99 0,0,5; 0,0,5; 0,1,6; 0,1,6; 0,2,10; 0,2,10; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,14; 2,2,14; 3,2,13; 3,2,13; 1,1,9; 1,1,9


SVG not supported

Login to reply

👍?
helpful
10:12pm Tue 15th Oct, ANONYMOUS

ANONYMOUS wrote:
> ANONYMOUS wrote: > > > Hi, before I accidentally posted these in someone elses article so I'll post it here instead: I would like to see if these test outputs are correct: > > > > > > > > in.txt: 0 0 0 0 0 1 1 0 0 0 1 1 2 3 3 2 1 2 > > > > out.txt: > > > > 99, 99, 2, 3 > > 4, 5, 6, 7 > > 99, 99, 0, 99 > > 99, 1, 99, 99 > > 2,2,17; 2,2,17; 3,1,14; 3,1,14; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,5; 1,0,5; 1,1,6; 1,1,6; 1,2,10; 1,2,10; 1,3,11; 1,3,11; > > > > > > > > in.txt: 0 0 0 0 0 1 1 2 2 3 3 2 2 1 1 > > > > out.txt: > > > > 99, 1, 2, 3 > > 99, 99, 4, 5 > > 99, 99, 6, 7 > > 99, 0, 99, 99 > > 3,1,10; 3,1,10; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,2,13; 1,2,13; 1,3,14; 1,3,14; 2,2,11; 2,2,11; 2,3,12; 2,3,12; > > > > > > > > int.txt: 0 0 0 0 1 0 0 2 3 1 0 2 3 3 2 > > > > out.txt: > > > > 0, 1, 2, 3 > > 4, 7, 99, 99 > > 99, 99, 5, 99 > > 99, 99, 6, 99 > > 0,0,0; 0,0,0; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,14; 2,2,14; 3,2,13; 3,2,13; 1,1,9; 1,1,9;
Is the above line correct, because I'm getting the output, which is different: 0,0,0; 0,0,0; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,5; 1,0,5; 2,2,15; 2,2,15; 3,2,14; 3,2,14; 1,1,10; 1,1,10


SVG not supported

Login to reply

👍?
helpful
1:37am Wed 16th Oct, ANONYMOUS

ANONYMOUS wrote:
> ANONYMOUS wrote: > > > ANONYMOUS wrote: > > > > > Hi, before I accidentally posted these in someone elses article so I'll post it here instead: I would like to see if these test outputs are correct: > > > > > > > > > > > > in.txt: 0 0 0 0 0 1 1 0 0 0 1 1 2 3 3 2 1 2 > > > > > > out.txt: > > > > > > 99, 99, 2, 3 > > > 4, 5, 6, 7 > > > 99, 99, 0, 99 > > > 99, 1, 99, 99 > > > 2,2,17; 2,2,17; 3,1,14; 3,1,14; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,5; 1,0,5; 1,1,6; 1,1,6; 1,2,10; 1,2,10; 1,3,11; 1,3,11; > > > > > > > > > > > > in.txt: 0 0 0 0 0 1 1 2 2 3 3 2 2 1 1 > > > > > > out.txt: > > > > > > 99, 1, 2, 3 > > > 99, 99, 4, 5 > > > 99, 99, 6, 7 > > > 99, 0, 99, 99 > > > 3,1,10; 3,1,10; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,2,13; 1,2,13; 1,3,14; 1,3,14; 2,2,11; 2,2,11; 2,3,12; 2,3,12; > > > > > > > > > > > > int.txt: 0 0 0 0 1 0 0 2 3 1 0 2 3 3 2 > > > > > > out.txt: > > > > > > 0, 1, 2, 3 > > > 4, 7, 99, 99 > > > 99, 99, 5, 99 > > > 99, 99, 6, 99 > > > 0,0,0; 0,0,0; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,14; 2,2,14; 3,2,13; 3,2,13; 1,1,9; 1,1,9; > > Is the above line correct, because I'm getting the output, which is different: > 0,0,0; 0,0,0; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,5; 1,0,5; 2,2,15; 2,2,15; 3,2,14; 3,2,14; 1,1,10; 1,1,10
It is incorrect, the first 1 will be loaded at time 4 (for both ignore and not) while the second 1 will be loaded at time 7 if you ignore and 9 if you don't.


SVG not supported

Login to reply

👍?
helpful
8:48am Wed 16th Oct, Joshua N.

Yep. They are both correct.


SVG not supported

Login to reply

👍?
helpful
1:47am Thu 17th Oct, ANONYMOUS

can someone explain step-by-step the calls to the RAM because why does the time jump up so fast? ;-;


SVG not supported

Login to reply

👍?
helpful
3:06pm Thu 17th Oct, Joshua N.

Time increases by 1 every time you read a number from in.txt. See here: [help2002]

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy