Hey there! Sign in to join this conversationNew here? Join for free
    • PS Helper
    • Wiki Support Team
    Offline

    14
    PS Helper
    Wiki Support Team
    (Original post by spikeymike)
    The answer is you can, however I don't think it would work as well as I want it too. :holmes:

    I'll try tomorrow I suppose, I'm getting sick doing the CA.
    Create an actual Java applet to show it rather than in a terminal window, that would be really cool :holmes:
    • PS Helper
    • Thread Starter
    Offline

    0
    ReputationRep:
    PS Helper
    (Original post by secretmessages)
    Create an actual Java applet to show it rather than in a terminal window, that would be really cool :holmes:
    Yeah it would be, but how easy is it? I'm doing the CA in C and it's being compiled by gcc in Ubuntu. :holmes:
    • PS Helper
    • Wiki Support Team
    Offline

    14
    PS Helper
    Wiki Support Team
    (Original post by spikeymike)
    Yeah it would be, but how easy is it? I'm doing the CA in C and it's being compiled by gcc in Ubuntu. :holmes:
    Not particularly easy, I wouldn't know how to do it without researching.
    • PS Helper
    • Thread Starter
    Offline

    0
    ReputationRep:
    PS Helper
    (Original post by secretmessages)
    Not particularly easy, I wouldn't know how to do it without researching.
    That's the end of that idea then. :p:

    I'm not doing anymore, tomorrow I'll just be writing a short report on it and tidying the code up ready for submission on Sunday. :teehee:
    • PS Helper
    • Wiki Support Team
    Offline

    14
    PS Helper
    Wiki Support Team
    (Original post by spikeymike)
    That's the end of that idea then. :p:

    I'm not doing anymore, tomorrow I'll just be writing a short report on it and tidying the code up ready for submission on Sunday. :teehee:
    Stupid group project until the end of the week :sad:. We won't finish!!! Maybe I should stop caring
    • PS Helper
    • Thread Starter
    Offline

    0
    ReputationRep:
    PS Helper
    (Original post by secretmessages)
    Stupid group project until the end of the week :sad:. We won't finish!!! Maybe I should stop caring
    Speak to your tutor/lecturer?
    • PS Helper
    • Wiki Support Team
    Offline

    14
    PS Helper
    Wiki Support Team
    (Original post by spikeymike)
    Speak to your tutor/lecturer?
    Nothing he can/will do.

    Some of these Eurovision hopefuls are hopeless.
    • PS Helper
    • Wiki Support Team
    Offline

    14
    PS Helper
    Wiki Support Team
    http://news.bbc.co.uk/1/hi/uk/8564154.stm :holmes:

    According to this, the new high speed rail link is planned to go straight through the middle of my university :teeth:
    • PS Helper
    • Thread Starter
    Offline

    0
    ReputationRep:
    PS Helper
    (Original post by secretmessages)
    http://news.bbc.co.uk/1/hi/uk/8564154.stm :holmes:

    According to this, the new high speed rail link is planned to go straight through the middle of my university :teeth:
    If it stops in your uni campus, that would be awesome.
    • PS Helper
    • Wiki Support Team
    Offline

    14
    PS Helper
    Wiki Support Team
    (Original post by spikeymike)
    If it stops in your uni campus, that would be awesome.
    Looks like it has stations either side :sad:. But that would be damn awesome having a high speed rail link to London just a minute's walk away :awesome:
    • PS Helper
    • Thread Starter
    Offline

    0
    ReputationRep:
    PS Helper
    (Original post by secretmessages)
    Looks like it has stations either side :sad:. But that would be damn awesome having a high speed rail link to London just a minute's walk away :awesome:
    It will probably cost a bomb. :p:

    That's 1hr of Masterchef out the way. 3 hrs of TV to go. :indiff:
    • PS Helper
    • Wiki Support Team
    Offline

    14
    PS Helper
    Wiki Support Team
    (Original post by spikeymike)
    It will probably cost a bomb. :p:

    That's 1hr of Masterchef out the way. 3 hrs of TV to go. :indiff:
    I still have one Neighbours to watch, then TV is done for the evening. I have to code a priority queue for tomorrow.. any idea? The difficult bit is that I have an object, and one attribute of that object is the value (say, between 1 and 100) that represents the priority. But how do I store the whole object in the queue, rather than just the priority (and they are not unique)?? :erm:
    • PS Helper
    • Thread Starter
    Offline

    0
    ReputationRep:
    PS Helper
    (Original post by secretmessages)
    I still have one Neighbours to watch, then TV is done for the evening. I have to code a priority queue for tomorrow.. any idea? The difficult bit is that I have an object, and one attribute of that object is the value (say, between 1 and 100) that represents the priority. But how do I store the whole object in the queue, rather than just the priority (and they are not unique)?? :erm:
    Why store the object and priority? :holmes:
    • PS Helper
    • Wiki Support Team
    Offline

    14
    PS Helper
    Wiki Support Team
    (Original post by spikeymike)
    Why store the object and priority? :holmes:
    Well how would I store just one of them?
    • PS Helper
    • Thread Starter
    Offline

    0
    ReputationRep:
    PS Helper
    (Original post by secretmessages)
    Well how would I store just one of them?
    An array of ints for priority?
    • PS Helper
    • Wiki Support Team
    Offline

    14
    PS Helper
    Wiki Support Team
    (Original post by spikeymike)
    An array of ints for priority?
    Not following you :no:

    ?
    • PS Helper
    • Thread Starter
    Offline

    0
    ReputationRep:
    PS Helper
    (Original post by secretmessages)
    Not following you :no:

    ?
    Priority values (integers): 1-100

    Code:
    int priorityQueue[100];   // array represents the queue, storing max 100 priorities
    
    priorityQueue[1] = 1
    priorityQueue[2] = 2;
    AFAIK, an array can be re-ordered like if say:

    Code:
    priorityQueue[3] = 75
    priorityQueue[4] = 2;
    The 4th memory position can be moved ahead of 3rd as obviously 2 is < 75. :holmes: This reminds me of something I did last semester... sequential sorting, random sorting etc.
    • PS Helper
    • Wiki Support Team
    Offline

    14
    PS Helper
    Wiki Support Team
    (Original post by spikeymike)
    Priority values (integers): 1-100

    Code:
    int priorityQueue[100];   // array represents the queue, storing max 100 priorities
    
    priorityQueue[1] = 1
    priorityQueue[2] = 2;
    AFAIK, an array can be re-ordered.
    Poor performance surely, if you were to insert an element you would have to shift every other element down. Also it would have to be a variable-size array :dontknow:
    • PS Helper
    • Thread Starter
    Offline

    0
    ReputationRep:
    PS Helper
    (Original post by secretmessages)
    Poor performance surely, if you were to insert an element you would have to shift every other element down. Also it would have to be a variable-size array :dontknow:
    That would be the only way to store a list of numbers AFAIK. If you want an undefined sized array then use a vector.
    • PS Helper
    • Wiki Support Team
    Offline

    14
    PS Helper
    Wiki Support Team
    Anyway, how do I store two attributes in the same array position? I would have to store the "ID", lets call it (a string), and the priority itself.
 
 
 
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.

Updated: October 26, 2011
Poll
Do you agree with the PM's proposal to cut tuition fees for some courses?

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

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