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
public static boolean isBST(Node head){ | |
if(head == null){ | |
return false; | |
}else{ | |
return isBST(head, Integer.MIN_INTEGER, Integer.MAX_INTEGER); | |
} | |
} | |
private static boolean isBST(Node head, int min, int max){ | |
if(head == null){ |
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
public static void rotateArr(int[][] mat, int n){ | |
if (mat == null){ | |
return; | |
} | |
for(int i = 0; i < n/2; i++){ | |
int last = n-1-i; | |
int len = n-1; | |
for(int j = i; j<last;j++){ | |
int offset = j-i; |
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
public static int[] merge(int[] a, int[] b) { | |
int[] answer = new int[a.length + b.length]; | |
int i = 0, j = 0, k = 0; | |
while (i < a.length && j < b.length) | |
{ | |
if (a[i] < b[j]) | |
answer[k++] = a[i++]; |
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
5 | |
/ \ | |
2 6 | |
/ \ | |
1 3 | |
\ | |
4 |
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
5 | |
/ \ | |
2 6 | |
/ \ | |
1 3 | |
\ | |
4 |
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 main(): | |
PF1 = "124*+3-22+-3/2/3*" | |
PF2 = "65-4*54/7*+9-9-" | |
global tos | |
tos = -1 | |
def push(s, elem): | |
global tos | |
tos = 1+tos |
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
# Gather some data that is of interest to you. | |
# Analyze the data using a scatterplot matrix. List at least 3 non-trivial | |
#findings about the data, along with plot pictures that show the findings. | |
### Imports ### | |
import numpy as np | |
import pandas as pd | |
from pandas import Series, DataFrame | |
import os |
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
#class survey data surveyV01.csv | |
#Use Pandas to clean all the problems you can find in the data and write a | |
#single clean surveyCleaned_LastName.csv file. | |
#Submit a list of all the types of problems you found, and for each problem | |
#show the Python code you used to fix it, in the textbox. | |
### Imports ### | |
import numpy as np |
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
# Gather some data that is of interest to you. | |
# Analyze the data using a scatterplot matrix. List at least 3 non-trivial | |
#findings about the data, along with plot pictures that show the findings. | |
### Imports ### | |
import numpy as np | |
import pandas as pd | |
from pandas import Series, DataFrame | |
import os |
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
28 Nevada | |
30 New Jersey | |
6 Connecticut | |
32 New York | |
38 Pennsylvania | |
22 Michigan | |
13 Illinois | |
14 Indiana | |
11 Hawaii | |
9 Florida |