This file contains 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
public class Q11_8{ | |
public static void main(String[] args){ | |
Node root = new Node(5); | |
track(1,root); | |
track(1,root); | |
} | |
public static Node track(int i, Node root){ | |
if root == null |
This file contains 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
public class Q11_8{ | |
public static void main(String[] args){ | |
Node root = new Node(5); | |
track(1,root); | |
track(1,root); | |
} | |
public static Node track(int i, Node root){ | |
if root == null |
This file contains 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
public class Q11_8{ | |
public static void main(String[] args){ | |
Node root = new Node(5); | |
track(1,root); | |
track(1,root); | |
} | |
public static Node track(int i, Node root){ | |
if root == null |
This file contains 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
public class Q11_8{ | |
public static void main(String[] args){ | |
Node root = new Node(5); | |
track(1,root); | |
track(1,root); | |
} | |
public static Node track(int i, Node root){ | |
if root == null |
This file contains 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
public class Q11_8{ | |
public static void main(String[] args){ | |
Node root = new Node(5); | |
track(1,root); | |
track(1,root); | |
} | |
public static Node track(int i, Node root){ | |
if root == null |
This file contains 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
public class Q11_8{ | |
public static void main(String[] args){ | |
Node root = new Node(5); | |
track(1,root); | |
track(1,root); | |
} | |
public static Node track(int i, Node root){ | |
if root == null |
This file contains 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 Chapter5; | |
public class Q5_8{ | |
static void drawHorizontalLine(byte[] screen, int width, int x1, int x2, int y){ | |
int height = screen.length/width/8; | |
int startOffset = x1%8; | |
int firstFullByte = x1/8; | |
if(startOffset!=0) | |
firstFullByte ++; |
This file contains 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 Chapter5; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
public class Q5_7{ | |
public static void main(String[] args){ | |
int[] test = {6,1,2,3,4,5,11,7,8,9,15,0,16,14,12,10,13}; | |
int n = 17; | |
System.out.println(getMiss(test,n)); |
This file contains 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
public class Q5_6{ | |
public static void main(String[] args){ | |
int test = 0b01011100110100010101001; | |
System.out.println(Integer.toBinaryString(swap(test))); | |
} | |
static int swap(int input){ | |
return ((input & 0x55555555) << 1) | ((input & 0xaaaaaaaa)>>1); | |
} | |
} |
This file contains 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
public class Q5_5{ | |
public static void main(String[] args){ | |
int test1= 0b100111010110; | |
int test2= 0b011001000101; | |
System.out.println(numberOfCovert(test1,test2)); | |
} | |
static int numOfConvert(int number1, int number2){ | |
int temp = number1^ number2; | |
int count = 0; | |
while(temp>0){ |
NewerOlder