How to remove the first number from a queue?

Hi,
I am trying to implement the following code for a queue. I've made an attempt on the RemoveFromQueue method, but it doesn't seem to work. How would i correctly be able the method for it to be able to remove the first number from the queue? thanks.
  if (q.QueueIsEmpty())
        System.out.println("Queue empty");
  else
         int firstEntry = q.RemoveFromQueue();     
              System.out.println("Integer extracted  : "  + firstEntry);
int RemoveFromQueue ()
         if (QueueIsEmpty())
               return false;
         else
              for(i=1; i <= total; i++)
                    Queue[i-1] = Queue;
                     total--;
                     return -1;
}

int RemoveFromQueue ()
if (QueueIsEmpty())
return false;
     else
     for(i=1; i <= total; i++)
     Queue[i-1] = Queue;
     total--;
     return -1;
}Here we go:
1) if the queue is empty you attempt to return 'false' while the method itself is
supposed to return an int.
2) you attempt to assign an entire queue to a single queue element.
3) your indentation is a mess.
4) why do you test for an empty queue outside of that method?
5) use pencil and paper and scribble down exactly what you want to do.
6) don't use initial uppercase letters for method names.
kind regards,
Jos

Similar Messages

  • How can I remove the page number from the first page of the document that is the cover page?

    How can I remove the page number from the first page of the document that is the cover page?

    If you open the Pages panel, (Window>Pages) you will see thumbnails of your master pages and your document pages. In new documents, there is usually a master called A-Master and one called None. If you drag the thumbnail of the None master onto the thumbnail of a document page, it will apply that master to that page. Presumably, you have made your page numbers on A-Master, so this will usually do the trick. If you have elements on A-Master that you need on the first page, but just not the page number, you can duplicate A-Master (which, by default will give you B-Master, but you can change the names if you like) and remove the page number on the duplicate and apply that to the document page.
    It might also be worth noting that you can apply master pages in the fly-out of the Pages panel. Go to the fly-out triangle and go down to Apply Master to Pages…, then select a master to apply and the range of pages (1-8 will give you all 8, 1, 3, 5, 7 will be the odds, 1-3, 4, 6-8 if you want continuous ranges and individual pages).

  • How do I remove the page number from first page?

    I'm new at Ai so this may be basic.  I can't figure out how to eliminate the page number from the first page.  Any help would be appreciated.

    Normally I would have a different master page for the first page, then have no page number on that master page.
    Apply this master to the first page.
    Or you can manually override the frame by holding CTRL SHIFT and clicking on the frame, then delete it.

  • How can i remove the phone number from the text messages that i receive in the notification center

    how can i remove the phone number from the text messages that i receive in the notification center?

    You choose whether to see text messages in Notification Center or not.  If you elect to see them, they will display the phone number (unless they are from a contact in your contacts list).
    You can choose not to see them at Settings > Notification Center > Messages.

  • How to delete the first page from a large number of documents

    Hello all,
    My company has migrated from Adobe Acrobat pro 8 to 11. In version 8 we had
    used Document Processing to remove the first page from all pdf's within a
    directory (5000+). This process took about an hour.
    Now my research has led me to use Actions in version 11, however it appears
    that the action require each document to be open and saved (one after another)
    in Acrobat in order for the first page to be removed.  This thrashing has made this process very
    slow to the point where it's useable.
    Is there any way to run actions from the command line
    so time isn't wasted opening up each document in Acrobat? 
    Is there another way to quickly remove the first page
    from a PDF in bulk?
    I'm outside my expertise area here, so if you need any additional
    information let me know.
    Thanks in advance.

    Indeed, batch processing in Acrobat XI is inferior in many ways to what it was previously.
    To answer your questions:
    1. No.
    2. Yes, it can be done using a stand-alone app much more quickly and more efficiently, but it's somewhat more complicated to develop such an app than to set up an Action in Acrobat.

  • How to remove the credit card from the Apple id?

    how to remove the credit card from the Apple id?
    plz ITS urgently

    If the option to select "None" isn't appearing when you attempt to edit your payment information, then there is likely a billing issue with your last iTunes Store purchase(iTunes didn't receive payment from your credit card company for that order). Before you can remove your credit card, you have to pay for the unpaid order. You can call your credit card company and troubleshoot the billing issue with them, or try another card, or if you live in a country that supports iTunes Gift Cards, you can redeem one of those to pay for the order. Once you have done that, you should be able to remove your credit card info as outlined in http://support.apple.com/kb/ht1918

  • How to hide the PORT NUMBER from the URL

    Hi,
    We have Application on Node 1 and Database on Node 2
    Apps Version: 11.5.10.2
    DB: 9.2.0.6
    We recently added a new node to act as web server for iSupport.
    Now we are able to access the url using public Ip-address which looks like
    http://<Internet Ip-Address>:<PORT NUMBER>
    Eg: http://******.com:8000
    But we dont want the *'PORT NUMBER(8000)'* to be displayed.
    How to hide the port number ?..
    Thanks in Advance,
    Mahesh

    Hi Hsawwan,
    Can you plz explain me the steps how to hide the port number from the url as our network administrator is not aware of this.
    Regards,
    Mahesh

  • How to remove the silican ball from the audio jack

    how to remove the silican ball from the audio jack in DV6 6116 laptop

    Try a vacuum, otherwise it will certainly require disassembly to attempt to remove it from the jack.
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • How to remove the Planned leave from the LOV of Absence status? Only confirmed leave should be listed. for 11i instance.

    Hi Gurus,
    How to remove the Planned leave from the LOV of Absence status? Only confirmed leave should be listed. for 11i instance.
    Thanks
    Shobhit Shukla

    Hi Shobhit,
    Please personalize the self-service page and make that field non-updatable with default value "Confirmed".
    Thanks,
    Avinash

  • How to remove the IT policy from my Torch 9800, or how to reset the device to original setting

    I have a Torch 9800 formerly- used for business emails. According to our company policy there was an IT policy installed to the device hence would force the user to set password protecting the device.
    Now this device has been retired and I like to use it only for regular phone calls thus do not like to have a password protection. My question is:
    How to remove the IT policy from the device?
    or
    How to reset the device to original setting?
    I have been trying to swipe and scrub the device several times but that IT policy still exist. Need help......
    Solved!
    Go to Solution.

    See the RIM Knowledge Base article here for information on how to remove an IT Policy. See the Method Three in the link:
    KB14202 How to remove an IT policy from a BlackBerry smartphone
    Read this RIM Knowledge Base article to reset your device to the factory settings.
    KB18998 How to reset a BlackBerry smartphone to factory defaults
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How to remove the approved order from the table in sapui5

    Hi Experts,
      how to remove the approved order from the table in sapui5.
    After Approving the order how to remove the order from the table in sapui5.
    Please help me.
    Thanks & regards
    chitti Babu

    Hi,
    Probelm is OBIEE on your machine.Some one might have deleted pdf option.
    Refer : http://obiee101.blogspot.com/2009/07/obiee-dashboard-default-controls.html
    Try to find out tag that is to be removed from controlmessages.xl so that you have only HTML.
    Update :
    Stop BI Server.Try removing below tag and restart server.
    (sawm:if name="enablePDF">(a class="NQWMenuItem" name="pdf" href="javascript:void(null)" onclick="return PortalPrint('@{pdfURL}[javaScriptString]',@{bNewWindow});">
    <sawm:messageRef name="kmsgDashboardPrintPDF"/></a)</sawm:if)
    Regards,
    Srikanth
    Edited by: Srikanth Mandadi on Apr 19, 2011 3:36 AM

  • How to remove the pic icon from the start screen?

    How to remove the pic icon from the start screen?

    You can turn it off via Settings > General > Passcode Lock > Picture Frame , but only if you have a passcode set - if you don't use a passcode lock, then you can't turn picture frame off (the option will be greyed out)

  • How to remove the default theme from "Revolution theme" to create our own movies and put our own background..

    how to remove the default theme from 'Revolution theme" to create movies of our own and a background..
    how to create chapter maker for movies...

    Are you using iDVD? Or iMovie?
    If iDVD, post in -> https://discussions.apple.com/community/ilife/idvd.
    If iMovie, post in -> https://discussions.apple.com/community/ilife/imovie.
    Good luck,
    Clinton

  • How to remove the time slider from my project and keep only buttons

    How to remove the time slider from my project and keep only buttons to interact with my project .

    If I understand you correctly, go to the skin editor (Project, Skin Editor in Captivate 4), select the Playback Control tab, uncheck the Progressbar check box.  Leave checked the buttons for play/pause, rewind, forward, back, etc.
    I hope this helps.
    Mister C.

  • Does anyone know how to remove the fisheye effect from a gopro camera, remove it with premiere pro c

    Does anyone know how to remove the fisheye effect from a gopro camera, remove it with premiere pro cc.

    Use the Lens Distortion effect, set curvature to your liking.

Maybe you are looking for

  • Error in creation of a condition record

    Hi to all, I've this error when I try to create a condition record : Implementation of Method FIELD_CHECK/DEFAULT_VALUE_SUGGESTION for BAdI /SAPCND/ROLLNAME for filter ZIUSERSTATUS is missing Message no. /SAPCND/MAINTENANCE719 Diagnosis Implementatio

  • Installing ipod mini to mac os x 10.4.8

    hi i have an old ipod mini and have just got os x 10.4.8.with itunes 7.1. when i put the disk in to install my ipod it says i cant and need software update. when i tried to install that it said i first needed installer update. when i tried to install

  • Essbase 11.1.2 dimension build slow

    Hi All, I wonder if anyone has had similar problems or ideas of how to solve the problem I have. We've recently migrated to Essbase 11.1.2 running on some big SPARC 64 bit servers and everything is going well. We have a problem with dimension builds

  • Sharing printer between Mac and Windows

    I have a printer connected to my TC, which is used a router.  I have two Windows machines connected to the TC, one wired and one Wifi.  How do I accesss my printer from my Windows machines ?

  • Can you post iWeb to iCloud?  If so, how do you do it?

    Can you publish iWeb to iCloud?  If so, how do you do it?