Skip to content

Instantly share code, notes, and snippets.

given an array of size n in which every number is between 1 and n, determine if there are any duplicates.
ask dumb questions:
are they ints, is it sorted, are there any restrictions. Can you use additional space. Can it be empty.
go with brute force question (make sure it's rock solid)
/*Checks 4 cases:
* when no argument is supplied & there are no stopped jobs
* when no argument is supplied & there is a stopped job
* when an argument is supplied & there is no stopped job at that jid or the argument is junk
* when an argument is supplied & there is a stopped job at that jid */
void
execute_bg_command()
{
struct list_elem *eJob = list_rbegin(&job_list);
struct esh_pipeline * lastJob = list_entry(eJob, struct esh_pipeline, elem);
bool
execute_plugin(struct esh_command * cmd)
{
struct list_elem * e = list_begin(&esh_plugin_list);
for (; e != list_end(&esh_plugin_list); e = list_next (e)){
struct esh_plugin * currPlugin = list_entry(e, struct esh_plugin, elem);
if(currPlugin->process_builtin == NULL){
continue;
#Fit a linear regression line to model IncomePerCapita 'y' as a function of
#PercentCollegeGrad 'x' from the states.csv data set.
### Imports ###
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import os
os.chdir('/home/edward/workspace/school/datavis')
os.getcwd()
28 Nevada
30 New Jersey
6 Connecticut
32 New York
38 Pennsylvania
22 Michigan
13 Illinois
14 Indiana
11 Hawaii
9 Florida
# 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
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
5
/ \
2 6
/ \
1 3
\
4