MedVision ad

algorithms please help (1 Viewer)

chloe_o

New Member
Joined
Oct 12, 2002
Messages
3
Hi,

I was wondering if someone could give me some help in regards to writing, reading and desk checking algorithms? I know the basics, I just have trouble recognising logic errors, searches, sorts etc. Really everything that comes after BEGIN main_program. :)

Does anyone have any hints to recognising stuff? And arggh I just don't get pseudocode. Or why every algorithm seems to use a counter. I just don't get it.

And EBNF and railroad diagrams - I can look at them at get syntactically correct statements but I sure as hell can't write them. Please help!!

Thanks.
 

Drnrg

New Member
Joined
Oct 25, 2002
Messages
6
you'll probably be given some code in a language that you've never seen before and probably outdated, then asked to draw an algorithm to extend some function of the program.
even though you dont knwo what the hell is going on in the first place, always show them you can do a loop and add a few numbers together, definate full marks.
 

CHUDYMASTER

Master of Chudy 'n' Curry
Joined
Oct 12, 2002
Messages
565
Gender
Undisclosed
HSC
2001
Well...

I'm afraid a lot of the things you're asking coming naturally with practice. Particularly algorithms. Although don't worry too much about railroad diagrams.

However, with regards to your counter confusion - look at it this way. You want to make a program which finds the average of an x number of inputted values. So you'll have to loop the input part, but within this, you must have something which COUNTS how many numbers are being inputted, because the program does not know what the user wants.

Hence, if you set the counter to 0 outside the loop and increment (eg. say counter = counter + 1), it will count the number of values entered so an average may be found, because as you know, average = the calculated total / counter (the no. of inputted values.)

If you're confused about the counter = counter + 1, don't think about it in terms of maths, by saying this, you're allocating counter the value counter (which originally starts as 0 or whatever) PLUS 1 each time.

Hope that helps.
 

user

Old enough to know better
Joined
Jul 28, 2002
Messages
306
Gender
Undisclosed
HSC
2002
think of writing railroad diagrams as building stuff with lego. U gotta know which block u need before u go search for it. So u have to rememebr all the little circles and stuff.

algorithms: i personally like to blame difficulties in interpretating algorithms on the teacher who wrote it.
 

grendel

day dreamer
Joined
Sep 10, 2002
Messages
103
Gender
Male
HSC
N/A
i would suggest u get ur hands on some of the old 2 and 3 unit comp studies hsc papers (download from the BOS website) and solutions if possible (EXCEL books used to supply answers to the previous years hsc). the 2 unit algorithm questions r pretty straightforward but they would be a good place 2 start and the 3 unit questions are more challenging.

also, lots of algorithm, EBNF, BNF and railroad diagram q's in the multiple choice section.
 

vertigo

New Member
Joined
Oct 30, 2002
Messages
26
Location
North Shore.
Originally posted by iptteacherssuck
are u doing hsc this yr ?
cuz ur screwed if u can't do that by now...
OMG don't say that please.... I still can't write good pseudocode yet either.
 

CHUDYMASTER

Master of Chudy 'n' Curry
Joined
Oct 12, 2002
Messages
565
Gender
Undisclosed
HSC
2001
??

There's no such thing as "good pseudocode" - pseudocode has no strict rules. Just make sure the logic makes sense. Perhaps you meant, "i'm crap at thinking up algorithms"?

Oh, in which case you are screwed. :D
 

user

Old enough to know better
Joined
Jul 28, 2002
Messages
306
Gender
Undisclosed
HSC
2002
pseudocode is like a combination of maths and english

it's a way of explaining how to do something in really simplified english.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top