Skip to content

Instantly share code, notes, and snippets.

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){
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;
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++];
5
/ \
2 6
/ \
1 3
\
4
5
/ \
2 6
/ \
1 3
\
4
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
# 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
#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
# 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
28 Nevada
30 New Jersey
6 Connecticut
32 New York
38 Pennsylvania
22 Michigan
13 Illinois
14 Indiana
11 Hawaii
9 Florida