Turn on thread page Beta
    • Thread Starter
    Offline

    1
    ReputationRep:
    Can anybody who knows Java well add me on msn ? im really stuck with some of my coursework and just need some help, any help would be appreciated. Its just for basic algorithms like linear search and stuff, any help kindly appreciated
    Thanks
    Zishan
    Offline

    13
    ReputationRep:
    What about your old topic?
    Offline

    0
    ReputationRep:
    Hey Mr-D!

    For Linear Search in Java:

    public static int linearSearch(int[] a, int first, int upto, int key) {

    for (int i = first; i < upto; i++) {
    if (key == a[i]) {
    return i; // Found key, return index.
    }
    }
    return -1; // Failed to find key
    }
    Taken from here

    Not sure if that covers your specific problem but there are so many sites with good resources out there, its worth finding ones that you feel explain best to you and bookmark them

    Good luck!
    Offline

    11
    ReputationRep:
    Best option is to post it here.
 
 
 
Poll
Do you like exams?
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

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.