Can you convert this to recursion ?

Can anyone Convert this to REcursion ?? (dont change the method signature, i have been trying for an hour but i got no luck, please post solutions , thanks !
public static int binarySearchR(int[] a, int key) {
int bot = 0, top = a.length;
while (bot < top) {
int mid = (bot + top)/2;
if (key < a[mid])
top = mid;
else if (key > a[mid])
bot = mid + 1;
else return mid;
return -1;
}

Forums trolls are people who just flame posts for
attention.I see. So after all these years I've been on the forum and thought I knew what trolls were, all along it was me who was the troll. Thanks for letting me know.
im looking for any hints how to do it. Not really. Looks to me like you're just looking for it to get done by someone else.
>
and its not homework. get your facts right. its a
exercise from a lab. that has no grading policy.As if that makes a difference.

Similar Messages

  • Can you convert this file into good searchable pdf file: Medical Terminology- A Short Course.azw4

    Can you convert this file into good searchable pdf file: Medical Terminology- A Short Course.azw4

    I don't think that Adobe offers any software to convert .azw4 files.  Search Google for alternate converters.

  • Trying to drag pdf files i have and combine them into one pdf file in the account i just purchased with Adobe. when i drag a pdf file over Adobe doesn't accept it. says it can not convert this type of file. but it is an Adobe file. Do I need to change it?

    Trying to drag pdf files i have and combine them into one pdf file in the account i just purchased with Adobe. when i drag a pdf file over Adobe doesn't accept it. says it can not convert this type of file. but it is an Adobe file. Do I need to change it in some other form befor dragging it?

    Hello djensen1x,
    Could you please let me know what version of Acrobat are you using.
    Also, tell me your workflow of combining those PDF files?
    Please share the screenshot of the error message that you get.
    Hope to get your response.
    Regards,
    Anubha

  • I have 13 dollars left on an apple store gift card, how can I convert this into money for my iTunes account?

    I have 13 dollars left on an apple store gift card, how can I convert this into money for my iTunes account?

    You can't.

  • Can you convert a PDF to Word in Arabic?

    Hello,
    Can you convert a pdf to word in Arabic?
    When I want to convert a file, adobe does not offer me Arabic.
    Can you help me please?
    Thank's

    Hi sahar mandour,
    Your subscription is not confirmed at our end.
    I will cancel it once it gets confirmed
    For your request of Arabic supported Export PDF you need to fill this form.
    Kindly refer this link: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform&loc=en
    Regards,
    Florence

  • Can you convert your desktop site plan into the phone & tablet version w/o re-creating the pages?

    Can you convert your desktop site plan into the phone & tablet version without re-creating the landing pages? This seems too extensive to have to re-design each page?

    Cwsnell,
    On your nav bar there is a shorcut to other pages.
    The most effecient way I have found to do this from the phone layout,
    click on the page icon shown above
    type in the name of the page (and select the desktop version as indicated by the icon of the monitor)
    select all on that page (CTRL A / Command A) and copy (CTRL C / Command C)
    revert back to the phone layout page and paste (CTRL V / Command V)
    then resize, delete what you dont need, make any other edits and your done!
    There is not a way to copy a page entirely over.  The mobile version should have less information and less imagery to enable fast load times.
    -SiteSpot

  • How can i convert this data(00000000) into date format(yyyy-MM-dd)

    Hi,
    i am using this method to convert date format from string.
    public static string FormatDate(string inputDate, string inputFormat)
                System.DateTime date = DateTime.ParseExact(inputDate, inputFormat, null);
                string datepresent = DateTime.Now.Date.ToString("yyyy-MM-dd");
                return datepresent;
    its working properly,
    but when input data is like 00000000 i am getting error this is not valid.
    how can i convert this into date format any help..!

    Have you tried the above code:
    I can see it is working with both Date and DateTime destination nodes.
    Map:
    Functoid Parameters:
    Functoid Script:
    public static string FormatDate(string inputDate, string inputFormat)
    string datepresent;
    if (inputDate == "00000000")
    datepresent = "0000-00-00";
    else
    System.DateTime date = DateTime.ParseExact(inputDate, inputFormat, null);
    datepresent = date.ToString("yyyy-MM-dd");
    return datepresent;
    Input:
    <ns0:InputDateString xmlns:ns0="http://DateFormat.SourceSchema">
    <DateString>00000000</DateString>
    </ns0:InputDateString>
    Output:
    <ns0:OutputDate xmlns:ns0="http://DateFormat.DestinationSchema">
    <Date>0000-00-00</Date>
    </ns0:OutputDate>
    If this answers your question please mark as answer. If this post is helpful, please vote as helpful.

  • Can you convert your text messages to your computer?

    Can you convert your text messages from your phone to your computer?

    Text messages are included with your iPhone's backup, which is updated by iTunes as the first step during the iTunes sync process. There are utilities such as this one that provide for extracting this and other data from your iPhone's backup for access on your computer for reading, printing, archiving, etc.
    http://mobilesyncbrowser.com/
    There are other utilities such as this one which is compatible with a Mac for extracting select data direct from the iPhone.
    http://www.ecamm.com/mac/phoneview/

  • Can you convert a variable text (spanning multiple rows) but fixed

    Hi all,
    I have a PDF table with 5 columns, couple of title rows at the top and four lines per row table into Excel? I'd want each excel row to have four lines as four combined rows. Think of each column as a date, an ID, a mailing address, an amount and a comment. It looks like a typical form, but on multiple pages (about 27) and I want all the info as an Excel table. Can I convert this PDF doc into Excel?
    Any pointers and/or solutions welcome... Please help.
    Thanks much in advance,
    Nash

    No, there isn't. Pages can't break within a row, only between rows.
    If you not are going to print the document you can change the paper size to something larger/longer. File > Page Setup > Paper Size > Manage custom sizes

  • Can you convert a Windows Quickbooks Pro 2011 file to an Ibank file?

    does anyone know if you can you convert a Windows Quickbooks Pro 2011 file to an Ibank file?

    I can't answer for Internet Explorer but you should be able to export Bookmarks from FireFox. If you can't export from IE you may be able to import from EI to FireFox first.
    In FireFox, menu BookMarks>Organize Bookmarks, then in the pane which opens, menu File>Export (that's how it works on Linux so Windows should be broadly similar). The result should be an html file.
    You may be able to import this into Safari on your Mac; certainly you should be able to import it into FireFox and perhaps from there to Safari if necessary.

  • Can you convert a favourites file from windows to a bookmark file for mac?

    can you convert a favourites file from windows to a bookmark file for mac?

    I can't answer for Internet Explorer but you should be able to export Bookmarks from FireFox. If you can't export from IE you may be able to import from EI to FireFox first.
    In FireFox, menu BookMarks>Organize Bookmarks, then in the pane which opens, menu File>Export (that's how it works on Linux so Windows should be broadly similar). The result should be an html file.
    You may be able to import this into Safari on your Mac; certainly you should be able to import it into FireFox and perhaps from there to Safari if necessary.

  • Regarding receiving texts as emails:  Can you apply this setting to one individual? I want to continue to receive texts from everyone else except one person!

    Regarding receiving texts as emails:  Can you apply this setting to one individual? I want to continue to receive texts from everyone else except one person!

    Don't want to block the person, just have all his texts going directly to my email so that I can maintain a continuous record of his text contacts (rather than remain in text form).
    It appears that I must select an option that makes ALL texts go to email, which I'd prefer not doing.

  • I have no audio what so ever i have seen in one of the tables where it was deleted how can you fix this i tried everything i know

    == Issue
    ==
    I have another kind of problem with Firefox
    == Description
    ==
    i have been trying to get the audio to play for 3 days now i did see where it had been deleted this is a used comp i haven't had it long can you fix this i'm at my wits end
    == Firefox version
    ==
    3.6.3
    == Operating system
    ==
    Windows NT 5.0
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
    == Plugins installed
    ==
    *-Default Plug-in
    *Adobe Acrobat Plug-In Version 5.10 for Netscape
    *Java(TM) Platform SE binary
    *Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
    *Network Object Plugin
    *Windows Multimedia Services DRM Store Plug-In
    *Npdsplay dll

    Hello Virginia.
    You may be having a problem with some extension or plugin that is hindering your Firefox's normal behavior. Have you tried disabling all add-ons (just to check), to see if Firefox goes back to normal?

  • I have Photoshop CS4,on how many computers can you install this program ?

    Hello,
    I got Photoshop CS4. On how many computers can you install this program ?
    Sonste

    The license and activation rights are for a single user on two computers that are not used simultaneously—such as your desktop machine and your laptop.

  • Is there anyone there? I hope there is someone who can you understand this problem and have the common sense to respond?  I open gmail. I want to save an email to one of my folders. I position my cursor over the appropriate Folder icon or by choice, to th

    Is there anyone there? I hope there is someone who can you understand this problem and have the common sense to respond?
    I open gmail. I want to save an email to one of my folders.
    I position my cursor over the appropriate Folder icon or by choice, to the Trash.
    The friendly finger pointing cursor icon changes to an arrow icon.
    The hand icon allows me flawless access to opening and/or moving emails.
    The arrow, however does not open the link.
    On the Google menu bar the cursor hand with finger opens the links to Everett (my name), Search, Images, Maps and Play.
    When I attempt to open the remaining links in the menu bar (YouTube, News, Gmail, Drive, Calendar and More) the arrow icon replaces the hand. The arrow icon does not work. It will not activate these links.  Nor does it open email messages in the Inbox.
    Usually I reset, even reboot Safire and sometimes the problem goes away, then reappears.
    Can you imagine if this condition should it happen to a tech savvy Google Support person? Perhaps one can share and make my problem go away.
    I am considering dropping Google as my mail source. Unfortunate!
    Everett Halvorsen
    [email protected]
    718.490.3824

    I have uninstalled my Access Connection, but this problem seems to persist. IBM technician have changed the wireless card of my T60, the first few days after it was changed was very fine, no problem at all. About a week later, the problem occured again, and it happened quite frequently after that occurence. Now i really have no idea what is the cause and how to solve it. Will be greatful if there is anyone that can help me.

Maybe you are looking for