AQA Computing COMP 3- 22nd June 2016 [Exam Discussion]

Announcements
    Offline

    0
    ReputationRep:
    (Original post by RedRum99)
    Did
    every one get -1344 or something like that for the floating point question?
    Yes
    Offline

    0
    ReputationRep:
    Did anyone do a(ba|c)* for the last question?
    Offline

    2
    ReputationRep:
    (Original post by Swizzas)
    Did anyone do a(ba|c)* for the last question?
    I thought it was just ac*
    Offline

    2
    ReputationRep:
    (Original post by RedRum99)
    Did everyone get -1344 or something like that for the floating point question?
    Yeah
    Offline

    2
    ReputationRep:
    (Original post by Swizzas)
    Did anyone do a(ba|c)* for the last question?
    I got a(ba)*c*
    Offline

    3
    ReputationRep:
    (Original post by TercioOfParma)
    I got a(ba)*c*
    This is incorrect, unfortunately, as the "ba"s and "c"s could be mixed in any order so the correct answer would be a(ba|c)*.
    Offline

    1
    ReputationRep:
    (Original post by Swizzas)
    Did anyone do a(ba|c)* for the last question?
    Definitely a(ba|c)* yeah
    Offline

    2
    ReputationRep:
    (Original post by Mav1)
    This is incorrect, unfortunately, as the "ba"s and "c"s could be mixed in any order so the correct answer would be a(ba|c)*.
    Well, you could go accbac and that doesn't match so it can't be that either.
    Offline

    3
    ReputationRep:
    (Original post by TercioOfParma)
    Well, you could go accbac and that doesn't match so it can't be that either.
    That string would be accepted by the FSM and fits the rule.
    Offline

    2
    ReputationRep:
    (Original post by Mav1)
    That string would be accepted by the FSM.
    Yes, but it wouldn't be accepted by that regex.
    Offline

    1
    ReputationRep:
    (Original post by TercioOfParma)
    Well, you could go accbac and that doesn't match so it can't be that either.
    a(ba|c)* means it can go
    a ba c
    a c ba
    a c ba c
    a ba c ba
    etc, so accbac is accepted
    Offline

    2
    ReputationRep:
    (Original post by cybernatural)
    a(ba|c)* means it can go
    a ba c
    a c ba
    a c ba c
    a ba c ba
    etc, so accbac is accepted
    Are you sure? I think that just means ababa or acc. I don't know for certain honestly, I know I got it wrong regardless

    Edit: Just checked yeah that works.
    Offline

    3
    ReputationRep:
    (Original post by TercioOfParma)
    Yes, but it wouldn't be accepted by that regex.
    It would be, I think the confusion arises as you might not understand (ba|c)*. This does NOT mean choose ba or c then repeat that. It mean many choices of ba or c.
    Offline

    2
    ReputationRep:
    Does anybody remember the diagram for the regex in the last question? I just wrote ac* - I think I may have missed a b that returns to the first state.

    Some areas which caused my class confusion:

    For the SQL query question, you only needed the data described in the question, so the customer table was not needed. To get the correct price, you needed to compare the weight in the parcel to the min and max values in the price bands. No clue whether it should be ascending or descending - the question asked for the oldest date "at the top of the list" but I don't if top to bottom or bottom to top is "ascending".

    For the DeleteItem procedure (pseudocode in the linked list question), you need to take into account if the first item in the list was the item to be deleted. Then you cannot change Previous and instead set Start = Current.Next. I also took into account if the item was the last in the list, so you would have to set Previous.Next to a null pointer, but I'm not sure if that would be required.
    Offline

    2
    ReputationRep:
    (Original post by Bunderwump)
    For the DeleteItem procedure (pseudocode in the linked list question), you need to take into account if the first item in the list was the item to be deleted. Then you cannot change Previous and instead set Start = Current. I also took into account if the item was the last in the list, so you would have to set Previous.Next to a null pointer, but I'm not sure if that would be required.
    I thought you had to delete the item that had the value supplied as the parameter.
    Offline

    3
    ReputationRep:
    (Original post by RedRum99)
    I thought it was just ac*
    Thats what I did.
    Offline

    2
    ReputationRep:
    (Original post by TercioOfParma)
    I thought you had to delete the item that had the value supplied as the parameter.
    You're right, there's a mistake in my explanation. You set Start = Current.Next if Current is the first in the list.
    Offline

    2
    ReputationRep:
    (Original post by Bunderwump)
    You're right, there's a mistake in my explanation. You set Start = Current.Next if Current is the first in the list.
    I didn't use start at all in the loop, I set current and previous to start (to avoid null pointer issues) and simply assigned current to current.next and previous to current afterwards.
    Offline

    2
    ReputationRep:


    We had to have one of these.
    Offline

    2
    ReputationRep:
    (Original post by TercioOfParma)
    I didn't use start at all in the loop, I set current and previous to start (to avoid null pointer issues) and simply assigned current to current.next and previous to current afterwards.
    That's right (you don't have to set previous to start depending on how you coded it afterwards) but if the element you need to delete is the first in the list, then you need to change the value of Start to the new start of the list (which would be Start.Next or Current.Next) - otherwise Start will be a null pointer after the procedure has finished.
 
 
 
Write a reply… Reply
Submit reply

Register

Thanks for posting! You just need to create an account in order to submit the post
  1. this can't be left blank
    that username has been taken, please choose another Forgotten your password?
  2. this can't be left blank
    this email is already registered. Forgotten your password?
  3. this can't be left blank

    6 characters or longer with both numbers and letters is safer

  4. this can't be left empty
    your full birthday is required
  1. Oops, you need to agree to our Ts&Cs to register
  2. Slide to join now Processing…

Updated: September 19, 2016
TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

Poll
Which is the best season?
Useful resources

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Quick reply
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.