This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Iterator; | |
| public interface Aggregate { | |
| public abstract Iterator<Book> iterator(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/ruby | |
| def collatz(n) | |
| print n.to_s+"\n" | |
| if n%2 == 0 | |
| collatz(n/2) | |
| elsif n != 1 | |
| collatz(n*3+1) | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def prime(n) | |
| k=2 | |
| c=0 | |
| if n==1 | |
| print("false","\n") | |
| else | |
| while k<n-1 | |
| b=n%k | |
| if b==0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package test; | |
| import java.util.Random; | |
| public class RandomCreate { | |
| private int[] bitArray; | |
| /** | |
| * overLoad |
NewerOlder