Skip to content

Instantly share code, notes, and snippets.

public class Q5_6 {
public static void main(String[] args){
int test = 73;
System.out.println(Integer.toBinaryString(test));
System.out.println(Integer.toBinaryString(SwapEvenOdd(test)));
}
public static int SwapEvenOdd(int n){
int tempOdd = (n & 0x55555555) << 1;
public class Q5_5 {
public static void main(String[] args){
int a = 73;
int b =834;
System.out.println("Binary a is:"+Integer.toBinaryString(a));
System.out.println("Binary b is:"+Integer.toBinaryString(b));
System.out.println(bitDifference(a,b));
}
public class Q5_3 {
public static void main(String[] args){
int test = 0b11011001111111;
System.out.println(Integer.toBinaryString(test));
System.out.println(Integer.toBinaryString(getPrevious(test)));
System.out.println(Integer.toBinaryString(getNext(test)));
}
public static int getPrevious(int n){
public class Q5_2 {
public static void main(String[] args){
System.out.println(ToBinary(0.72,0));
System.out.println(ToBinary(0.87948723,0));
public class Q5_1 {
public static void main(String[] args){
int m =0b10011;
int n = 0b10000000001;
int i = 2;
int j = 6;
System.out.println(Integer.toBinaryString(InsertMN(m,n,i,j)));
package cc150_4_8;
public class CheckSubtree<Key extends Comparable<Key>> {
private Node root;
class Node{
private Key key;
public Node left;
public Node right;
package cc150_4_7;
public class CommonAncestor<Key extends Comparable<Key>> {
private Node root;
class Node{
private Key key;
public Node left;
public Node right;
package cc150_4_6;
public class NodeSuccessor<Key extends Comparable<Key>> {
private Node root;
class Node{
private Key key;
public Node left;
package cc_150_4_5;
import java.util.Stack;
public class CheckTree<Key extends Comparable<Key>> {
private Node root;
public class Node{
package cc150_4_4;
import java.util.LinkedList;
public class ComDepth<Key extends Comparable<Key>> {
public Node root;
public class Node{
private Key key;