Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Chit-Chat (http://www.chiefdelphi.com/forums/forumdisplay.php?f=14)
-   -   ap comp sci (http://www.chiefdelphi.com/forums/showthread.php?t=4328)

srawls 09-05-2002 17:23

ap comp sci
 
so, I know a few of you have said you're taking the ap comp sci test. how do think it was? i thought it wasn't really bad, but still don't know if i'll get a 4 or 5 ( but i'm fairly certain i'll get one of them). the free response wasn't bad either, i actually kind of liked that last one on the huffman encoding, made for a simple recursive algorithm (compared to the ugly iterative solutions for all the other problems). i'm reminded of a quote "to iterate is mortal, to recurse divine" ahh, i love geeky computer quotes :D

Stephen

Suike 09-05-2002 17:47

Well since I don't really like computer programming and I had to take it cuz it's part of the "CAT" curriculum and all I thought it was bad. Rather, I got most of the multiple choice, probably like 30/40 but the free-response I could only get the first two for certain and then guessed on the rest... tried to get those 1/2 points n all. BTW... I only took the A not AB test.

srawls 09-05-2002 18:01

ahh, ok. i took the ab test, and if you can't already tell, i love programming :D i enjoyed the survey at the end the best, actually. you see, my shcool doesn't offer the course so i took the test without having taken the course (i knew c++ before this year from self-study). well, when they asked 'how many hours per week does your class meet' and i answered 0, i figured i was skewing their data :)

prtynpink5 09-05-2002 18:19

oh my god, the programming A test killed me today. THe part ones werent that bad, but I only understood 2 of the part 2's they sucked! Ill be happy if i even get a 2

Joel J 09-05-2002 18:25

On this test, much like any other standardized test, I did not finish. The portions I did complete were manageable, so I think I did ok. Time will tell...

Jay Lundy 09-05-2002 21:49

Quote:

Originally posted by srawls
ahh, ok. i took the ab test, and if you can't already tell, i love programming :D i enjoyed the survey at the end the best, actually. you see, my shcool doesn't offer the course so i took the test without having taken the course (i knew c++ before this year from self-study). well, when they asked 'how many hours per week does your class meet' and i answered 0, i figured i was skewing their data :)
My friend took the test without taking the class too. I don't know how well he thinks he did on it yet, but we both looked at the free response questions from previous years and it seemed pretty easy. I would have taken it too but I decided I might as well wait and spend the $80 on the test after I take the class next year.

Melancholy 10-05-2002 16:56

Aqua FAIL!
 
yeah i dont like aqua fish we spent 2 months on it our teachers name happens to be mr. fisher hes a stupid stupid man i think i got at least a 4 though :p

Jan Olligs 10-05-2002 18:23

I think AB was alright, I was finished early with both parts. I liked their idea for Free Response Number 3 and free response problem by itself. It was a lot less enervating than Calc BC, where I just ralleyed through the Free Response.

Alfred Thompson 11-05-2002 18:31

love programming
 
I teach the AP CS course at my school. We just teach the AB program. My students call the case study the DAF. That's short for Dumb %%% Fish so apparently they are not impressed with it. Still they all think they got the case study questions right. We'll see.

Rukky G 12-05-2002 16:48

last on free response
 
What did you put for the last one? I'm curious because you seem sure of yourself and I am not. I put something like.

if(not at a leaf) return recall(char, left, string+"0") + recall(char, right, string+"1");
else (if char=letter) return pathsofar;
return "";

srawls 12-05-2002 17:26

hmm ... from memory: (i'm shortening function name to f)
Code:

apstring f (apstring *letter, Tree* T, apstring *path_so_far) {
  apstring temp;
  if (T->Left == NULL) { //T is a leaf
    if (T->data == letter) 
      return path_so_far;
    return "";
  }

  temp = f(letter,T->left,path_so_far + "0");
  if (temp == "")
    return f(letter,T->right,path_so_far + "1");
  return temp;
}

Stephen

Rukky G 12-05-2002 18:00

same thing, cool.

srawls 12-05-2002 18:05

well, yours looks better than mine, but mine is more efficient. considering the ap people probably don't care anything about efficiency, i probably should have done like you and not worried about checking if the left subtree matched or not.

Stephen

Mark Hamilton 12-05-2002 21:56

I aced the multiple choice part, but more then likely completely failed the 2nd part. You see, we never bothered to learn the AP classes or study the case study ( our teacher had never done ap before). It sucks because all of us in there couldve easily done all the required programming using standard c++ functions and variables. The functions they had your write were all rather simplistic and silly...they really need to redesign those tests.

Mike Soukup 13-05-2002 00:39

Re: last on free response
 
Quote:

Originally posted by Rukky G
What did you put for the last one? I'm curious because you seem sure of yourself and I am not. I put something like.
For all us older people, what was the question?

Mike

Alfred Thompson 13-05-2002 08:57

What was the question
 
The question is long so I will sumarize. There are 4 questions on the test and the test booklet is 16 pages long just to give you an idea.
The kids are talking about part b of the fourth question on the AB exam. There is an A exam and an AB exam. The AB covers a lot more matterial than the A exam.

In any case. The method CharToBitsHelper for the CodeTree class returns a binary representation of the the path to a specific letter in a binary tree of letters. Taking the left branch is indicated by a 0 and takingthe right branch is indicated by a 1. So if you take a left and two rights to find the letter CharToBitsHelp returns "011".

The actual method prototype (I have it in front of me) is

apstring CodeTree::CharToBitsHelper(char ch, Node * T, const apstring & pathSoFar) const
// postcondition: if ch is in subtree T, return code for ch

I'll post my solution shortly. I want to read part A before I start.

Alfred Thompson 13-05-2002 10:43

my solution
 
Node * Temp = T; // Pointer to use for traversal
apstring rtn = ""; // Return string

while (Temp != null && Temp.letter != ch)
{
if ( ch > Temp.Letter)
{
rtn += "1";
Temp = Temp->right;
}
else
{
rtn += 0;
Temp = Temp->left;
}
}
if (Temp.letter == ch)
return rtn;
else
return "";

The last bit is importent because you have to handle the case where the char is not found in the tree. My guess is that you will lose at least one point (of 4/5 for part b) if you leave that out.
You will probably also lose a point if you did not create your own temp pointer for the traversal. But that's just a guess.

SkitzoSmurf 13-05-2002 11:11

my school must really suck, because there's only Visual Basic here for programming, and there are absolutely NO AP computer courses, I wish though.

Alfred Thompson 13-05-2002 11:49

VB
 
Visual Basic is a great language. But I'm biased as our school uses a VB text book I wrote. :)

BTW I think there is a problem with my solution to the AP question. I realized that there isn't a letter in the nodes only the leaves. So you have to recursively search each path and return the one that is good. A whole different set of code. Back to the drawing board.

srawls 13-05-2002 14:40

Quote:

For all us older people, what was the question?
Basically, they constructed a huffman encoding tree, and they asked us to write a function, that given a letter and the tree (and a third argument, string_so_far, which is initially empty), we return the path to that letter. Of course, them being the ap people, they don't expect us 'dumb' kids to know what huffman encoding is, so they never actually called it huffman encoding, and they gave us hints in the question in how to answer it (like 'we suggest you use string_so_far in a recursive algoritm ...').

Oh, and yep, Mr. Thompson, you're right, the letters are only in the leaves. You can look at my solution or Rucky G's solution for a right anser. The only difference between ours is that I check to see if the letter is found in the left subtree before I look in the right subtree, he looks in every node of the tree in all cases. So, mine is more effecient, but I think his looks more elegant, since he takes advantage of the fact that if the letter is not found, he returns the empty string, and thus can be appended to the answer without changing it.

Stephen

Kyle Hill 13-05-2002 19:07

IMO, I did well enough to get a four on the comp sci A exam, and should I have done miraculously well on the part I, I might even have pulled a five. However, my answer to the case study part II would probably cause me to lose a few points here and there.

See, I looked at the fish maybe, uh, once, so I had no clue and knew as much going into the test. So my answer for #3 was to define 527 different variables.

You never know, I could always get a partial credit point or something maybe.... :rolleyes:

Rukky G 15-05-2002 08:21

Quote:

if ( ch > Temp.Letter)
That's not going to work either because the tree is not set up so that the letters go to the left or right because they're greater or less than. It was a random set up from the beginning, otherwise the encryption would be very easy to hack.

Alfred Thompson 15-05-2002 08:43

Quote:

Originally posted by Rukky G


That's not going to work either because the tree is not set up so that the letters go to the left or right because they're greater or less than. It was a random set up from the beginning, otherwise the encryption would be very easy to hack.

Yeah I realized that after I posted. Sloppy work on my part. What can I say, it's been a long year. For people who are interested in good solutions there is a set at http://cs.colgate.edu/APCSWeb/APCSDo...eResp2000.html that is very good. How good? Well the guy who wrote them tells the graders what to accept and what not to accept.

srawls 15-05-2002 14:24

Quote:

It was a random set up from the beginning, otherwise the encryption would be very easy to hack
I suppose it could be a random setup, but that's not most likely. Usually, in huffman encoding schemes, the most commonly used letter would have the shortest path, the second most commonly used letter would have the second shortest path, and so on. It is not used as a secure encryption method, but rather it is used to map letters into binary representations a computer can understand. In ascii, all leters are 8 bits, even if 7 of them are 0s, it still takes up a whole byte, while in huffman encoding, the length varies in each letter, which usually results in a shorter file.

Stephen


All times are GMT -5. The time now is 18:09.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi