Notices
Results 1 to 1 of 1

Thread: Big theta notation

  1. #1 Big theta notation 
    New Member
    Join Date
    Oct 2008
    Posts
    1
    Hi,
    I need to make a big-theta notation on an algoritm I made. The algoritm is soposed to find factors of a number. This is the algoritm implemented in java:
    Code:
    public class factor {
    
    	public static void main (String argv[]) 
    	{	
    		int number =(Integer.parseInt(argv[0]));
    		int counter = 0;
    
    		for(counter = 1 ; counter <= number/2 ; counter++)
    		{
    			if(number % counter == 0)System.out.println(counter);
    		}
    		System.out.println(number);
    	}
    }
    I figured the theta notation to this is: O(N)

    The problem is now that i need to express big theta as a function of of the length of N (the number
    of bits in N). I have no idea what I am supposed to do here? I would greatly appreciate if anyone could help.[/code]


    Reply With Quote  
     

  2.  
     

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
  •