Groups
Groups
Sign in
Groups
Groups
Code Gurukul
Conversations
About
Send feedback
Help
Result: Java Quiz: Show your java strength
17 views
Skip to first unread message
Kamlesh Paunikar
unread,
Sep 26, 2009, 6:22:32 AM
9/26/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Code Gurukul
Using Recursion
============
If you are using recursion in your logic then it
will take too much time to process 2 power n also
recursion will use huge memory of stack.
Using Loop
=========
This will not take memory but it will be heavy
code for processing.
and therefore we need some fine code that should not take too much
time.
1. Code should be easy
2. Code should be fine
3. Should not take much memory.
4. Should process as early as possible.
Final Answer
==========
/**
*
* @author Kamlesh Paunikar
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int n=30;
int pow=1<<n;
System.out.println("Power ="+pow);
}
}
Reply all
Reply to author
Forward
0 new messages