Notices
Results 1 to 2 of 2

Thread: question about algorithms

  1. #1 question about algorithms 
    New Member
    Join Date
    Nov 2009
    Posts
    1
    I need to make a divide&conquer algorithm for finding the dominant element in an array (dominant element = element which exists at least n/2 times in an array within the size n) . All you can do between those elements is compare them (no < relation or > relation) .
    Please help me because I'm really lost here...


    Reply With Quote  
     

  2.  
     

  3. #2  
    New Member
    Join Date
    Nov 2009
    Posts
    3
    It will help you for the calculation.Large number multiplication : Let (A1A0) and (B1B0) are n digit numbers, where each of A1, A0, B1, B0 are n/2 digit numbers.
    Multiplication of these numbers:
    A1A0 * B1B0 = A1 * B1 * 10(n) + (A1 * B0 + A0 * B1) * 10(n / 2) + A0 * B0.. Now here (A1 * B0 + A0 * B1) = ((A1 + A0) * (B1 + B0)) − ((A1 * B1) + (A0 * B0)).


    Reply With Quote  
     

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •