• Best of luck to the class of 2024 for their HSC exams. You got this!
    Let us know your thoughts on the HSC exams here
  • YOU can help the next generation of students in the community!
    Share your trial papers and notes on our Notes & Resources page
MedVision ad

Too much project work?? (1 Viewer)

edcox

New Member
Joined
Feb 5, 2008
Messages
6
Gender
Male
HSC
2008
Hi there,

We've been doing a fair bit on our ajor projects lately, i.e. Data flows, IPO's, Data dictionaries, and part A (Documentation) is due after half yearlies.

But

Today the teacher decided to do something different and make us write linear search and binary search algorithms. nobody had a clue. apparantly all this will be on our half yearlies, but we've done shit all.

Should I be worried, or will it come in time. I think i will start learning from the Davis book, because it's good, but i mean, it would be nice to learn what was on the exam in class..

Oh, btw, funniest shit, about a week ago he told the whole class to summarise this chapter in the Davis book, and the response was pretty much get fucked.

Any advice'd be great :)
 

Martyno1

oh hi
Joined
Feb 24, 2006
Messages
762
Location
Sydney
Gender
Male
HSC
2007
Last edited:

Deadly-Bagel

New Member
Joined
Nov 7, 2007
Messages
5
Gender
Male
HSC
2008
Wow, we nailed those at the start of yr 11. Definitely something you should know by now.

A binary search is easy. As long as you know how the sort works, you should be able to figure out the code.

Binary search must have the array in order. Otherwise it won't work. Take the middle value of the array using min + max / 2 and compare it to the number to be searched. If the number to be searched (let's call it X) is greater than the number in the middle of the array (let's call it mid), min now becomes mid and mid becomes min + max / 2. Keep doing this until Mid = X.

A linear search is easy. The array doesn't even have to be sorted. Have a count variable, call it i, i = 0 (or 1, depending on where the array starts), compare X to array, if they're not the same, then i = i + 1 and compare again.

This is quite easily obtained information, I know. My point is that I don't have these memorised. I know that binary means two. Divide the array into two until you get your answer. Linear means straight. Search the array in a straight line until you come to your answer. Not hard to figure out the code from there.


You should also learn the three main sorts too. Insertion, Bubble, and selection sort. You might need to know one to get your binary search working =P
 

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

Top