SlideShare a Scribd company logo
1 of 17
hw4/.DS_Store
__MACOSX/hw4/._.DS_Store
hw4/HW4Test.javahw4/HW4Test.javapackage hw4;
importstatic org.junit.Assert.*;
import java.util.LinkedList;
import org.junit.Test;
publicclassHW4Test{
String border ="***************************************
****n";
String passed ="* Passed! *n";
String failed ="* Failed! *n";
String test;
RandomRB rb;
AssertionError ae;
Exception e;
publicHW4Test(){
rb =newRandomRB();
}
privateboolean testValid(LLRB llrb){
if(llrb.root ==null)returntrue;
LinkedList<LLRB.Node> nodes =newLinkedList<LLRB.Node>(
);
nodes.add(null);
nodes.add(llrb.root);
boolean done =false;
while(!nodes.isEmpty()){
LLRB.Node n = nodes.removeFirst();
if(n ==null){
n = nodes.removeFirst();
done = n.right ==null;
if(!done) nodes.add(null);
}
if(!done){
if(n.left ==null|| n.right ==null)returnfalse;
if(n.left.color){
if(n.left.left ==null|| n.left.right ==null)returnfalse;
nodes.add(n.left.left);
nodes.add(n.left.right);
}else{
nodes.add(n.left);
}
nodes.add(n.right);
}else{
if(n.left !=null&&(!n.left.color || n.left.left !=null|| n.left.right !
=null))returnfalse;
if(n.right !=null)returnfalse;
}
}
returntrue;
}
publicvoid assertMrgNodes(LLRB llrb,int max4,int max3){
assertMrgTraversal(llrb.root,0, max4, max3);
}
privatevoid assertMrgTraversal(LLRB.Node n,int low,int max4,i
nt max3){
if(n ==null){
assertTrue(low /4*4+4> max4);
assertTrue(low /3*3+3> max3);
return;
}
// left subtree
int lmax4 =Math.min(max4, n.key -1);
int lmax3 =Math.min(max3, n.key -1);
assertMrgTraversal(n.left, low, lmax4, lmax3);
// right subtree
assertMrgTraversal(n.right, n.key +1, max4, max3);
}
publicvoid assertNodes(LLRB llrb,int max,int cons){
assertTraversal(llrb.root,1, max, cons);
}
privatevoid assertTraversal(LLRB.Node n,int low,int max,int co
ns){
if(n ==null){
assertTrue(low /4*4+4> max);
assertTrue(low > cons || low /4*4== cons);
return;
}
// left subtree
int lmax =Math.min(max, n.key -1);
int lcons =Math.min(cons, n.key -1);
assertTraversal(n.left, low, lmax, lcons);
// right subtree
assertTraversal(n.right, n.key +1, max, cons);
}
privatevoid testFix(){
LLRB llrb;
// Testing on valid red black trees
for(int i =0; i <128; i++){
llrb = rb.resetRandomTree(i);
assertTrue(testValid(llrb));
llrb.fixLLRB();
assertTrue(testValid(llrb));
}
// Testing on invalid red black trees
for(int i =0; i <128; i++){
for(int k =0; k <32; k++){
llrb = rb.resetRandomTree(i);
llrb.bstInsert(k *4+3);
if(llrb.isValidLLRB()){
llrb.bstInsert(k *4+2);// left invalid except when r
oot was null in rb
assertFalse(rb.depth >0&& testValid(llrb));
llrb.fixLLRB();
assertTrue(testValid(llrb));
llrb = rb.toLLRB();
llrb.bstInsert(k *4+2);
llrb.bstInsert(k *4+3);// right invalid
assertFalse(testValid(llrb));
llrb.fixLLRB();
assertTrue(testValid(llrb));
}else{// right invalid
llrb.fixLLRB();
assertTrue(testValid(llrb));
llrb.bstInsert(k *4+2);
llrb.bstInsert(k *4+1);// left invalid
assertFalse(testValid(llrb));
llrb.fixLLRB();
llrb.fixLLRB();
assertTrue(testValid(llrb));
}
}
}
}
privatevoid testMinBlackDepth(){
LLRB llrb;
// Testing on balanced red black trees
for(int i =0; i <128; i++){
llrb = rb.resetRandomTree(i);
for(int k =0; k <128; k++){
llrb.bstInsert(k);
// DEBUG : System.out.println("Verifying minimum black edge
count of tree for seed = " + i + " after red-
edged insertion of " + k + " is " + rb.depth);
assertEquals(rb.depth, llrb.minBlackEdgesDepth());
}
}
// Testing on unbalanced red black trees
for(int i =0; i <128; i++){
for(int k =0; k <96; k++){
rb.resetRandomTree(i);
int key = k /3*4+(k %3)+1;
rb.bstInsert(key,false);
// DEBUG : System.out.println("Verifying minimum black edge
count of tree for seed = " + i + " after black-
edged insertion of " + k + " is still " + rb.depth);
assertEquals(rb.depth ==0?1: rb.depth, rb.toLLRB().
minBlackEdgesDepth());
}
}
}
privatevoid testMaxBlackDepth(){
LLRB llrb;
// Testing on balanced red black trees
for(int i =0; i <128; i++){
llrb = rb.resetRandomTree(i);
for(int k =0; k <128; k++){
llrb.bstInsert(k);
// DEBUG : System.out.println("Verifying maximum black edge
count of tree for seed = " + i + " after red-
edged insertion of " + k + " is " + rb.depth);
assertEquals(rb.depth, llrb.maxBlackEdgesDepth());
}
}
// Testing on unbalanced red black trees
for(int i =0; i <128; i++){
for(int k =2; k <96; k++){
rb.resetRandomTree(i);
int key = k /3*4+(k %3)+1;
rb.bstInsert(key,false);
// DEBUG : System.out.println("Verifying maximum black edge
count of tree for seed = " + i + " after black-
edged insertion of " + k + " is " + (rb.depth + 1));
assertEquals(rb.depth +1, rb.toLLRB().maxBlackEdg
esDepth());
}
}
}
privatevoid testLeftRed(){
LLRB llrb;
// Testing on valid red black trees
for(int i =0; i <128; i++){
llrb = rb.resetRandomTree(i);
// DEBUG : System.out.println("Checking validity of tree for se
ed = " + i);
assertFalse(llrb.containsConsecutiveLeftRedEdges());
}
// Testing on invalid red black trees
for(int i =0; i <128; i++){
for(int k =0; k <32; k++){
rb.resetRandomTree(i);
rb.bstInsert(k *4+3,false);
rb.bstInsert(k *4+2,true);
rb.bstInsert(k *4+1,true);
// DEBUG : System.out.println("Checking invalidity of tree for
seed = " + i + " after inserting two edges on the left at " + (k * 4
+ 2) + " and " + (k * 4 + 1));
assertTrue(rb.toLLRB().containsConsecutiveLeftRed
Edges());
}
}
}
privatevoid testRightRed(){
LLRB llrb;
// Testing on valid red black trees
for(int i =0; i <128; i++){
llrb = rb.resetRandomTree(i);
// DEBUG : System.out.println("Checking validity of tree for se
ed = " + i);
assertFalse(llrb.containsRightRedEdge());
}
// Testing on invalid red black trees
for(int i =0; i <128; i++){
for(int k =0; k <32; k++){
rb.resetRandomTree(i);
rb.bstInsert(k *4+1,false);
rb.bstInsert(k *4+2,true);
// DEBUG : System.out.println("Checking invalidity of tree for
seed = " + i + " after inserting red edge on the right at " + (k * 4
+ 2));
assertTrue(rb.toLLRB().containsRightRedEdge());
}
}
}
privatevoid testIns(){
// Testing serial insertions into random red black trees
for(int i =0; i <128; i++){
// DEBUG : System.out.print("For seed = " + i + " inserting key
s :");
LLRB llrb = rb.resetRandomTree(i);
for(int k =0; k <96; k++){
int key = k /3*4+(k %3)+1;
// DEBUG : System.out.print(" " + key);
llrb.insert(key);
assertTrue(testValid(llrb));
assertNodes(llrb, rb.max, key);
}
// DEBUG : System.out.println("");
}
}
privatevoid testMethod(int method_id)throwsException{
try{
System.out.print(border + test + border);
switch(method_id){
case0: testIns();break;
case1: testRightRed();break;
case2: testLeftRed();break;
case3: testMaxBlackDepth();break;
case4: testMinBlackDepth();break;
case5: testFix();break;
}
}catch(AssertionError aerr){
ae = aerr;
}catch(Exception err){
e = err;
}
if(ae !=null|| e !=null){
System.out.print("n"+ border + test + failed + border);
System.out.println("failing case seed = "+ rb.seed +" and the co
rresponding tree:");
System.out.println(rb.toString());
if(ae !=null)throw ae;
if(e !=null)throw e;
}else{
System.out.print(border + test + passed + border);
}
}
@Test
publicvoid testFixLLRB()throwsException{
test ="* Testing fix LLRB *n";
testMethod(5);
}
@Test
publicvoid testMinBlackEdgesDepth()throwsException{
test ="* Testing minimum black edges depth *n";
testMethod(4);
}
@Test
publicvoid testMaxBlackEdgesDepth()throwsException{
test ="* Testing maximum black edges depth *n";
testMethod(3);
}
@Test
publicvoid testContainsConsecutiveLeftRedEdges()throwsExcep
tion{
test ="* Testing consecutive left red edges *n";
testMethod(2);
}
@Test
publicvoid testContainsRightRedEdge()throwsException{
test ="* Testing right red edge *n";
testMethod(1);
}
@Test
publicvoid testInsert()throwsException{
test ="* Testing insert *n";
testMethod(0);
COLLECTIVE BARGAINING EXERCISE
(100 POINTS)
I. READ THE FOLLOWING SITUATION AND CURRENT
CONTRACT PROVISIONS.
II. WRITE A PROPOSAL INDICATING WHAT YOUR TEAM
INTENDS TO OBTAIN
FOR EACH ISSUE. INCLUDE:
>> WHAT DOES YOUR TEAM THINK IS A REASONABLE
AMOUNT FOR EACH BARGAINING ISSUE? WHY??
>> WHAT ARE YOUR HIGH PRIORITY ITEMS? WHY??
>> WHAT ARE YOU WILLING TO TRADE IN EXCHANGE
FOR YOUR HIGH
PRIORITY ITEMS? WHY??
>> WHAT ISSUES IN ADDITION TO THE CURRENT
CONTRACT
PROVISIONS DO YOU PROPOSE? WHY??
(PROPOSALS = UP TO 40 POINTS, DUE APRIL 21, 2016)
III. NEGOTIATE A CONTRACT THAT IS ACCEPTABLE TO
BOTH PARTIES.
YOU MUST HAVE A CONTRACT SIGNED BY ALL
NEGOTIATING MEMBERS BY CLASS TIME, MAY 3, 2016).
IF AN IMPASSE IS REACHED HOWEVER, YOU MUST
FULLY EXPLAIN WHAT YOUR SIDE IS PLANNING TO DO.
A 25 POINT PENALTY IS ASSESSED IF THERE IS A
STRIKE OR LOCKOUT. CONTRACTS WILL BE GRADED
ON THEIR COMPLETENESS AND NEATNESS.
(CONTRACTS = UP TO 25 POINTS)
IV. EXPLAIN WHAT HAPPENED DURING YOUR
NEGOTIATIONS. THIS REPORT
SHOULD INCLUDE:
A. WHAT WERE THE HARDER ISSUES TO
NEGOTIATE? WHY?
B. WHAT WERE THE EASIER ISSUES TO NEGOTIATE?
WHY?
C. BASED ON HOW THIS CONTRACT TURNED
OUT, WHAT WOULD YOU ANTICIPATE HAPPENING
WHEN IT EXPIRES? WHAT ISSUES DID YOUR SIDE WIN?
LOSE? (BE SURE TO EXPLAIN WHY YOU WON OR LOST
ISSUES.) HOW WILL THESE AFFECT FUTURE CONTRACT
TALKS? WHY?
(REPORT = UP TO 15 POINTS, DUE WITH THE CONTRACT,
MAY 3, 2016
V. GROUP EVALUATION (20 POINTS BASED ON GROUP
AVERAGE RATING) (GROUPS MAY DISCHARGE
NONPERFORMING MEMBERS. TERMINATED MEMBERS
WILL RECEIVE A "0" FOR THE PROJECT. DUE MAY 3,
2016)
COLLECTIVE BARGAINING
The Melville Printing Company is a seventy year old printing
company located in a south central Kentucky. The company
manufactures a wide variety of items including brochures,
atlases, annual reports, and sales catalogs. Melville has always
enjoyed a reputation for high quality and reliability in meeting
delivery dates. The company employs 1241 skilled and semi-
skilled employees in addition to about 160 management and
staff personnel. The currently operate 24 hours per day, seven
days a week. The employees rotate on two 12 hour shifts (7 am
-7 pm and 7pm-7am).
The work force, consisting mainly of graphic arts, printing, and
typographical workers, was organized in 1966 by the
International Brotherhood of Printers (IBP). Labor-management
relations have generally been good, but some conflicts have
resulted in the past few years. While the company has not been
struck by IBP, the number of grievances and arbitration cases
has risen substantially in the past three years.
Historically, Melville held a sizeable share of the regional
market and enjoyed impressive profit margins. However, recent
competition has led to a gradual erosion in the past five years.
Competition is expected to increase, causing a great concern for
Melville's top management. The union has sympathized with
Melville's recent sales situation, but has let it be known that
they will fight for a considerably stronger contract than they
presently have. The company is still profitable with a stable
ROA of 4% and posted a net profit of $5,120,000 last year.
However, Management feels that it cannot afford to liberalize
the current contract to any significant extent. They may even
look for possible reductions or more cost sharing with respect to
benefits. The following reflects the current contract provisions.
The additional information provided comes mostly from a recent
pay survey of local employers considered to be in Melville’s
relevant labor market.
Last year’s total compensation for the non-exempt employees
covered by the contract was:
Hourly pay = $37,154,320
Overtime pay = $4,149,749
Benefits = $11,146,296
Your task is to negotiate a contract between the Melville
Printing Company and IBP.
CURRENT CONTRACT PROVISIONS
ISSUE
CURRENT CONTRACT PROVISIONS
ADDITIONAL INFORMATION
WAGES
Average wage = $12.05 PER HOUR
Range of $10.85 to $17.95 PER HOUR.
Shift differential of $.30 for night shift.
Wage rates for competing companies in the local area average
$14.35/hour, with a range of $8.75 to $19.75. Shift
differentials of shift, $.50 for nights.
OVERTIME
Premium pay of time and one half for all hours over 40 per
week. Also receive premium rate for Sundays and Holidays.
Each union employee averages 185 hours of overtime per year.
LAYOFF NOTICE
Minimum of 2 weeks advance notice for ANY layoff.
Five of the competing companies give 30 days notice. Eleven
others give 2 weeks. Another 6 companies surveyed give 60
days notice.
VACATION
Five days after 1 year of service.
Ten days for all employees with 2+ years of service.
Average union employee tenure at Melville = 8.5 years.
Most (75%) competing companies offer the following: 2 weeks
(10 days) after 1 year, 3 weeks after 10 years, and 4 weeks after
20 years.
LUNCH
Thirty minutes allowed for lunch/PAID.
Competing companies vary widely: From 30 minutes unpaid up
to 1 hour paid.
BREAKS
Two 10-minute breaks per 8 hour shift.
Also 10 minutes for personal clean-up at end of shift (Paid).
Competitors range from ten minute breaks to 20 minute breaks.
HOLIDAYS
Eight paid holidays (to be named in contract)
Competitors average 9 paid holidays.
BEREAVEMENT LEAVE
NONE
Competitors usually offer 3 days for immediate family.
LAYOFF
Need to determine the basis (e.g., seniority) for any layoffs and
other policy issues
Research this one.
SICK LEAVE
Receive one half day per month or 6 paid sick days per year.
No carry over.
Among competing firms: 5 have 6 days per year, 8 have 12 per
year, and 7 have no paid sick leave.
FMLA
Negotiate a FMLA policy
Federal law mandates 12 weeks unpaid.
SUPPLE-
MENTAL
UNEMP.
BENEFITS
NONE
SUB would cost the company an estimated $1000 per employee
per year.
HEALTH CARE
Company pays $405/month premium per employee for major
medical coverage with 80/20 co-pay with a maximum deductible
of $3000. Family coverage available at employee's expense
($275/month premium).
27% of the competing companies pay for family coverage.
Most use the 80/20 co-pay system for major medical with
maximum deductibles ranging from $500 to $6000.
EAP
NONE
Research this one.
DENTAL
CARE
NONE
If company pays, would cost $120 per employee with $100
deductible. Family coverage costs an additional $180 per
employee per year.,
PROFIT SHARE
NONE
(Provide all important details for any proposed plan!)
If current profit levels are maintained, typical payments to each
employee would be about $300 per year with a 25/75 split.
Two competitors offer gainsharing incentives.
GRIEVANCE PROCESS
NONE SPECIFIED IN CONTRACT, Employees register
complaints with an elected union steward who negotiates with
management personnel.
Most other union contracts specify procedures.
PENSION
NONE
(Provide all important details for any proposed plan!)
Melville is the only company in the area that doesn't have some
form of pension plan.
OTHER ISSUES:
TBA
YOUR OPPORTUNITY FOR ADDITIONAL RESEARCH
CONTRACT LENGTH
Three years
Among competing unionized companies: Three have 3 year
contracts, two have 2 year contracts, an one has a 1year
Each part will be graded using the following scale:
A= Demonstrates complete understanding of all concepts.
Shows insights and initiative by providing information beyond
the text and this handout. Accurately cites all outside research.
B= Demonstrates complete understanding of all but a few
concepts. Shows evidence of work beyond the minimum
requirements.
C= Demonstrates basic understanding of most key concepts.
Provides answers to the parts based mainly on the text and this
handout. Limits contract coverage to issues currently stated.
D= Demonstrates confusion on some key concepts, and/or
evidence of minimal effort. Employees would probably raise
many questions with the contract.
F= Unacceptable work due to confusing explanations of key
concepts, major omissions, or other errors which demonstrates a
lack of understanding of the concepts or lack of effort.

More Related Content

Similar to hw4.DS_Store__MACOSXhw4._.DS_Storehw4HW4Test.javahw4.docx

Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113SOAT
 
PVS-Studio in 2021 - Error Examples
PVS-Studio in 2021 - Error ExamplesPVS-Studio in 2021 - Error Examples
PVS-Studio in 2021 - Error ExamplesAndrey Karpov
 
Ensure code quality with vs2012
Ensure code quality with vs2012Ensure code quality with vs2012
Ensure code quality with vs2012Sandeep Joshi
 
Pepe Vila - Cache and Syphilis [rooted2019]
Pepe Vila - Cache and Syphilis [rooted2019]Pepe Vila - Cache and Syphilis [rooted2019]
Pepe Vila - Cache and Syphilis [rooted2019]RootedCON
 
Introduction to Software Testing
Introduction to Software TestingIntroduction to Software Testing
Introduction to Software TestingSergio Arroyo
 
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docxfilesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docxssuser454af01
 
Node Boot Camp
Node Boot CampNode Boot Camp
Node Boot CampTroy Miles
 
Introduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicoxIntroduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicoxDavid Rodenas
 
Score (smart contract for icon)
Score (smart contract for icon) Score (smart contract for icon)
Score (smart contract for icon) Doyun Hwang
 
Spock: Test Well and Prosper
Spock: Test Well and ProsperSpock: Test Well and Prosper
Spock: Test Well and ProsperKen Kousen
 
Let’s talk about microbenchmarking
Let’s talk about microbenchmarkingLet’s talk about microbenchmarking
Let’s talk about microbenchmarkingAndrey Akinshin
 
Clean Code Development
Clean Code DevelopmentClean Code Development
Clean Code DevelopmentPeter Gfader
 
The Future of JVM Languages
The Future of JVM Languages The Future of JVM Languages
The Future of JVM Languages VictorSzoltysek
 
So I already have most of the code and now I have to1. create an .pdf
So I already have most of the code and now I have to1. create an .pdfSo I already have most of the code and now I have to1. create an .pdf
So I already have most of the code and now I have to1. create an .pdfarjuncollection
 

Similar to hw4.DS_Store__MACOSXhw4._.DS_Storehw4HW4Test.javahw4.docx (20)

cypress.pdf
cypress.pdfcypress.pdf
cypress.pdf
 
Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113
 
PVS-Studio in 2021 - Error Examples
PVS-Studio in 2021 - Error ExamplesPVS-Studio in 2021 - Error Examples
PVS-Studio in 2021 - Error Examples
 
Ensure code quality with vs2012
Ensure code quality with vs2012Ensure code quality with vs2012
Ensure code quality with vs2012
 
C# labprograms
C# labprogramsC# labprograms
C# labprograms
 
Pepe Vila - Cache and Syphilis [rooted2019]
Pepe Vila - Cache and Syphilis [rooted2019]Pepe Vila - Cache and Syphilis [rooted2019]
Pepe Vila - Cache and Syphilis [rooted2019]
 
Introduction to Software Testing
Introduction to Software TestingIntroduction to Software Testing
Introduction to Software Testing
 
Typescript barcelona
Typescript barcelonaTypescript barcelona
Typescript barcelona
 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Print
 
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docxfilesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
 
Node Boot Camp
Node Boot CampNode Boot Camp
Node Boot Camp
 
Introduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicoxIntroduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicox
 
Message in a bottle
Message in a bottleMessage in a bottle
Message in a bottle
 
Score (smart contract for icon)
Score (smart contract for icon) Score (smart contract for icon)
Score (smart contract for icon)
 
Spock: Test Well and Prosper
Spock: Test Well and ProsperSpock: Test Well and Prosper
Spock: Test Well and Prosper
 
Mod04 debuggers
Mod04 debuggersMod04 debuggers
Mod04 debuggers
 
Let’s talk about microbenchmarking
Let’s talk about microbenchmarkingLet’s talk about microbenchmarking
Let’s talk about microbenchmarking
 
Clean Code Development
Clean Code DevelopmentClean Code Development
Clean Code Development
 
The Future of JVM Languages
The Future of JVM Languages The Future of JVM Languages
The Future of JVM Languages
 
So I already have most of the code and now I have to1. create an .pdf
So I already have most of the code and now I have to1. create an .pdfSo I already have most of the code and now I have to1. create an .pdf
So I already have most of the code and now I have to1. create an .pdf
 

More from wilcockiris

Barbara Silva is the CIO for Peachtree Community Hospital in Atlanta.docx
Barbara Silva is the CIO for Peachtree Community Hospital in Atlanta.docxBarbara Silva is the CIO for Peachtree Community Hospital in Atlanta.docx
Barbara Silva is the CIO for Peachtree Community Hospital in Atlanta.docxwilcockiris
 
BARGAIN CITY Your career is moving along faster than you e.docx
BARGAIN CITY Your career is moving along faster than you e.docxBARGAIN CITY Your career is moving along faster than you e.docx
BARGAIN CITY Your career is moving along faster than you e.docxwilcockiris
 
Barbara schedules a meeting with a core group of clinic  managers. T.docx
Barbara schedules a meeting with a core group of clinic  managers. T.docxBarbara schedules a meeting with a core group of clinic  managers. T.docx
Barbara schedules a meeting with a core group of clinic  managers. T.docxwilcockiris
 
Barbara schedules a meeting with a core group of clinic managers.docx
Barbara schedules a meeting with a core group of clinic managers.docxBarbara schedules a meeting with a core group of clinic managers.docx
Barbara schedules a meeting with a core group of clinic managers.docxwilcockiris
 
Barbara schedules a meeting with a core group of clinic managers. Th.docx
Barbara schedules a meeting with a core group of clinic managers. Th.docxBarbara schedules a meeting with a core group of clinic managers. Th.docx
Barbara schedules a meeting with a core group of clinic managers. Th.docxwilcockiris
 
Barbara Rosenwein, A Short History of the Middle Ages 4th edition (U.docx
Barbara Rosenwein, A Short History of the Middle Ages 4th edition (U.docxBarbara Rosenwein, A Short History of the Middle Ages 4th edition (U.docx
Barbara Rosenwein, A Short History of the Middle Ages 4th edition (U.docxwilcockiris
 
BARBARA NGAM, MPAShoreline, WA 98155 ▪ 801.317.5999 ▪ [email pro.docx
BARBARA NGAM, MPAShoreline, WA 98155 ▪ 801.317.5999 ▪ [email pro.docxBARBARA NGAM, MPAShoreline, WA 98155 ▪ 801.317.5999 ▪ [email pro.docx
BARBARA NGAM, MPAShoreline, WA 98155 ▪ 801.317.5999 ▪ [email pro.docxwilcockiris
 
Banks 5Maya BanksProfessor Debra MartinEN106DLGU1A2018.docx
Banks    5Maya BanksProfessor Debra MartinEN106DLGU1A2018.docxBanks    5Maya BanksProfessor Debra MartinEN106DLGU1A2018.docx
Banks 5Maya BanksProfessor Debra MartinEN106DLGU1A2018.docxwilcockiris
 
Banking industry•Databases that storeocorporate sensiti.docx
Banking industry•Databases that storeocorporate sensiti.docxBanking industry•Databases that storeocorporate sensiti.docx
Banking industry•Databases that storeocorporate sensiti.docxwilcockiris
 
BAOL 531 Managerial AccountingWeek Three Article Research Pape.docx
BAOL 531 Managerial AccountingWeek Three Article Research Pape.docxBAOL 531 Managerial AccountingWeek Three Article Research Pape.docx
BAOL 531 Managerial AccountingWeek Three Article Research Pape.docxwilcockiris
 
bankCustomer1223333SmithJamesbbbbbb12345 Abrams Rd Dallas TX 75043.docx
bankCustomer1223333SmithJamesbbbbbb12345 Abrams Rd Dallas TX 75043.docxbankCustomer1223333SmithJamesbbbbbb12345 Abrams Rd Dallas TX 75043.docx
bankCustomer1223333SmithJamesbbbbbb12345 Abrams Rd Dallas TX 75043.docxwilcockiris
 
Barbara and Judi entered into a contract with Linda, which provi.docx
Barbara and Judi entered into a contract with Linda, which provi.docxBarbara and Judi entered into a contract with Linda, which provi.docx
Barbara and Judi entered into a contract with Linda, which provi.docxwilcockiris
 
bappsum.indd 614 182014 30258 PMHuman Reso.docx
bappsum.indd   614 182014   30258 PMHuman Reso.docxbappsum.indd   614 182014   30258 PMHuman Reso.docx
bappsum.indd 614 182014 30258 PMHuman Reso.docxwilcockiris
 
Bank ReservesSuppose that the reserve ratio is .25, and that a b.docx
Bank ReservesSuppose that the reserve ratio is .25, and that a b.docxBank ReservesSuppose that the reserve ratio is .25, and that a b.docx
Bank ReservesSuppose that the reserve ratio is .25, and that a b.docxwilcockiris
 
Bank Services, Grading GuideFIN366 Version 21Individual.docx
Bank Services, Grading GuideFIN366 Version 21Individual.docxBank Services, Grading GuideFIN366 Version 21Individual.docx
Bank Services, Grading GuideFIN366 Version 21Individual.docxwilcockiris
 
Baldwins Kentucky Revised Statutes AnnotatedTitle XXXV. Domesti.docx
Baldwins Kentucky Revised Statutes AnnotatedTitle XXXV. Domesti.docxBaldwins Kentucky Revised Statutes AnnotatedTitle XXXV. Domesti.docx
Baldwins Kentucky Revised Statutes AnnotatedTitle XXXV. Domesti.docxwilcockiris
 
Bank confirmations are critical to the cash audit. What information .docx
Bank confirmations are critical to the cash audit. What information .docxBank confirmations are critical to the cash audit. What information .docx
Bank confirmations are critical to the cash audit. What information .docxwilcockiris
 
BalShtBalance SheetBalance SheetBalance SheetBalance SheetThe Fran.docx
BalShtBalance SheetBalance SheetBalance SheetBalance SheetThe Fran.docxBalShtBalance SheetBalance SheetBalance SheetBalance SheetThe Fran.docx
BalShtBalance SheetBalance SheetBalance SheetBalance SheetThe Fran.docxwilcockiris
 
BAM 515 - Organizational Behavior(Enter your answers on th.docx
BAM 515 - Organizational Behavior(Enter your answers on th.docxBAM 515 - Organizational Behavior(Enter your answers on th.docx
BAM 515 - Organizational Behavior(Enter your answers on th.docxwilcockiris
 
BalanchineGeorge Balanchine is an important figure in the histor.docx
BalanchineGeorge Balanchine is an important figure in the histor.docxBalanchineGeorge Balanchine is an important figure in the histor.docx
BalanchineGeorge Balanchine is an important figure in the histor.docxwilcockiris
 

More from wilcockiris (20)

Barbara Silva is the CIO for Peachtree Community Hospital in Atlanta.docx
Barbara Silva is the CIO for Peachtree Community Hospital in Atlanta.docxBarbara Silva is the CIO for Peachtree Community Hospital in Atlanta.docx
Barbara Silva is the CIO for Peachtree Community Hospital in Atlanta.docx
 
BARGAIN CITY Your career is moving along faster than you e.docx
BARGAIN CITY Your career is moving along faster than you e.docxBARGAIN CITY Your career is moving along faster than you e.docx
BARGAIN CITY Your career is moving along faster than you e.docx
 
Barbara schedules a meeting with a core group of clinic  managers. T.docx
Barbara schedules a meeting with a core group of clinic  managers. T.docxBarbara schedules a meeting with a core group of clinic  managers. T.docx
Barbara schedules a meeting with a core group of clinic  managers. T.docx
 
Barbara schedules a meeting with a core group of clinic managers.docx
Barbara schedules a meeting with a core group of clinic managers.docxBarbara schedules a meeting with a core group of clinic managers.docx
Barbara schedules a meeting with a core group of clinic managers.docx
 
Barbara schedules a meeting with a core group of clinic managers. Th.docx
Barbara schedules a meeting with a core group of clinic managers. Th.docxBarbara schedules a meeting with a core group of clinic managers. Th.docx
Barbara schedules a meeting with a core group of clinic managers. Th.docx
 
Barbara Rosenwein, A Short History of the Middle Ages 4th edition (U.docx
Barbara Rosenwein, A Short History of the Middle Ages 4th edition (U.docxBarbara Rosenwein, A Short History of the Middle Ages 4th edition (U.docx
Barbara Rosenwein, A Short History of the Middle Ages 4th edition (U.docx
 
BARBARA NGAM, MPAShoreline, WA 98155 ▪ 801.317.5999 ▪ [email pro.docx
BARBARA NGAM, MPAShoreline, WA 98155 ▪ 801.317.5999 ▪ [email pro.docxBARBARA NGAM, MPAShoreline, WA 98155 ▪ 801.317.5999 ▪ [email pro.docx
BARBARA NGAM, MPAShoreline, WA 98155 ▪ 801.317.5999 ▪ [email pro.docx
 
Banks 5Maya BanksProfessor Debra MartinEN106DLGU1A2018.docx
Banks    5Maya BanksProfessor Debra MartinEN106DLGU1A2018.docxBanks    5Maya BanksProfessor Debra MartinEN106DLGU1A2018.docx
Banks 5Maya BanksProfessor Debra MartinEN106DLGU1A2018.docx
 
Banking industry•Databases that storeocorporate sensiti.docx
Banking industry•Databases that storeocorporate sensiti.docxBanking industry•Databases that storeocorporate sensiti.docx
Banking industry•Databases that storeocorporate sensiti.docx
 
BAOL 531 Managerial AccountingWeek Three Article Research Pape.docx
BAOL 531 Managerial AccountingWeek Three Article Research Pape.docxBAOL 531 Managerial AccountingWeek Three Article Research Pape.docx
BAOL 531 Managerial AccountingWeek Three Article Research Pape.docx
 
bankCustomer1223333SmithJamesbbbbbb12345 Abrams Rd Dallas TX 75043.docx
bankCustomer1223333SmithJamesbbbbbb12345 Abrams Rd Dallas TX 75043.docxbankCustomer1223333SmithJamesbbbbbb12345 Abrams Rd Dallas TX 75043.docx
bankCustomer1223333SmithJamesbbbbbb12345 Abrams Rd Dallas TX 75043.docx
 
Barbara and Judi entered into a contract with Linda, which provi.docx
Barbara and Judi entered into a contract with Linda, which provi.docxBarbara and Judi entered into a contract with Linda, which provi.docx
Barbara and Judi entered into a contract with Linda, which provi.docx
 
bappsum.indd 614 182014 30258 PMHuman Reso.docx
bappsum.indd   614 182014   30258 PMHuman Reso.docxbappsum.indd   614 182014   30258 PMHuman Reso.docx
bappsum.indd 614 182014 30258 PMHuman Reso.docx
 
Bank ReservesSuppose that the reserve ratio is .25, and that a b.docx
Bank ReservesSuppose that the reserve ratio is .25, and that a b.docxBank ReservesSuppose that the reserve ratio is .25, and that a b.docx
Bank ReservesSuppose that the reserve ratio is .25, and that a b.docx
 
Bank Services, Grading GuideFIN366 Version 21Individual.docx
Bank Services, Grading GuideFIN366 Version 21Individual.docxBank Services, Grading GuideFIN366 Version 21Individual.docx
Bank Services, Grading GuideFIN366 Version 21Individual.docx
 
Baldwins Kentucky Revised Statutes AnnotatedTitle XXXV. Domesti.docx
Baldwins Kentucky Revised Statutes AnnotatedTitle XXXV. Domesti.docxBaldwins Kentucky Revised Statutes AnnotatedTitle XXXV. Domesti.docx
Baldwins Kentucky Revised Statutes AnnotatedTitle XXXV. Domesti.docx
 
Bank confirmations are critical to the cash audit. What information .docx
Bank confirmations are critical to the cash audit. What information .docxBank confirmations are critical to the cash audit. What information .docx
Bank confirmations are critical to the cash audit. What information .docx
 
BalShtBalance SheetBalance SheetBalance SheetBalance SheetThe Fran.docx
BalShtBalance SheetBalance SheetBalance SheetBalance SheetThe Fran.docxBalShtBalance SheetBalance SheetBalance SheetBalance SheetThe Fran.docx
BalShtBalance SheetBalance SheetBalance SheetBalance SheetThe Fran.docx
 
BAM 515 - Organizational Behavior(Enter your answers on th.docx
BAM 515 - Organizational Behavior(Enter your answers on th.docxBAM 515 - Organizational Behavior(Enter your answers on th.docx
BAM 515 - Organizational Behavior(Enter your answers on th.docx
 
BalanchineGeorge Balanchine is an important figure in the histor.docx
BalanchineGeorge Balanchine is an important figure in the histor.docxBalanchineGeorge Balanchine is an important figure in the histor.docx
BalanchineGeorge Balanchine is an important figure in the histor.docx
 

Recently uploaded

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 

Recently uploaded (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

hw4.DS_Store__MACOSXhw4._.DS_Storehw4HW4Test.javahw4.docx

  • 1. hw4/.DS_Store __MACOSX/hw4/._.DS_Store hw4/HW4Test.javahw4/HW4Test.javapackage hw4; importstatic org.junit.Assert.*; import java.util.LinkedList; import org.junit.Test; publicclassHW4Test{ String border ="*************************************** ****n"; String passed ="* Passed! *n"; String failed ="* Failed! *n"; String test; RandomRB rb; AssertionError ae; Exception e; publicHW4Test(){ rb =newRandomRB(); } privateboolean testValid(LLRB llrb){ if(llrb.root ==null)returntrue; LinkedList<LLRB.Node> nodes =newLinkedList<LLRB.Node>( ); nodes.add(null); nodes.add(llrb.root);
  • 2. boolean done =false; while(!nodes.isEmpty()){ LLRB.Node n = nodes.removeFirst(); if(n ==null){ n = nodes.removeFirst(); done = n.right ==null; if(!done) nodes.add(null); } if(!done){ if(n.left ==null|| n.right ==null)returnfalse; if(n.left.color){ if(n.left.left ==null|| n.left.right ==null)returnfalse; nodes.add(n.left.left); nodes.add(n.left.right); }else{ nodes.add(n.left); } nodes.add(n.right); }else{ if(n.left !=null&&(!n.left.color || n.left.left !=null|| n.left.right ! =null))returnfalse; if(n.right !=null)returnfalse; } } returntrue; } publicvoid assertMrgNodes(LLRB llrb,int max4,int max3){ assertMrgTraversal(llrb.root,0, max4, max3); } privatevoid assertMrgTraversal(LLRB.Node n,int low,int max4,i nt max3){ if(n ==null){ assertTrue(low /4*4+4> max4); assertTrue(low /3*3+3> max3); return;
  • 3. } // left subtree int lmax4 =Math.min(max4, n.key -1); int lmax3 =Math.min(max3, n.key -1); assertMrgTraversal(n.left, low, lmax4, lmax3); // right subtree assertMrgTraversal(n.right, n.key +1, max4, max3); } publicvoid assertNodes(LLRB llrb,int max,int cons){ assertTraversal(llrb.root,1, max, cons); } privatevoid assertTraversal(LLRB.Node n,int low,int max,int co ns){ if(n ==null){ assertTrue(low /4*4+4> max); assertTrue(low > cons || low /4*4== cons); return; } // left subtree int lmax =Math.min(max, n.key -1); int lcons =Math.min(cons, n.key -1); assertTraversal(n.left, low, lmax, lcons); // right subtree assertTraversal(n.right, n.key +1, max, cons); } privatevoid testFix(){ LLRB llrb; // Testing on valid red black trees for(int i =0; i <128; i++){ llrb = rb.resetRandomTree(i); assertTrue(testValid(llrb)); llrb.fixLLRB();
  • 4. assertTrue(testValid(llrb)); } // Testing on invalid red black trees for(int i =0; i <128; i++){ for(int k =0; k <32; k++){ llrb = rb.resetRandomTree(i); llrb.bstInsert(k *4+3); if(llrb.isValidLLRB()){ llrb.bstInsert(k *4+2);// left invalid except when r oot was null in rb assertFalse(rb.depth >0&& testValid(llrb)); llrb.fixLLRB(); assertTrue(testValid(llrb)); llrb = rb.toLLRB(); llrb.bstInsert(k *4+2); llrb.bstInsert(k *4+3);// right invalid assertFalse(testValid(llrb)); llrb.fixLLRB(); assertTrue(testValid(llrb)); }else{// right invalid llrb.fixLLRB(); assertTrue(testValid(llrb)); llrb.bstInsert(k *4+2); llrb.bstInsert(k *4+1);// left invalid assertFalse(testValid(llrb)); llrb.fixLLRB(); llrb.fixLLRB(); assertTrue(testValid(llrb)); } } } } privatevoid testMinBlackDepth(){ LLRB llrb;
  • 5. // Testing on balanced red black trees for(int i =0; i <128; i++){ llrb = rb.resetRandomTree(i); for(int k =0; k <128; k++){ llrb.bstInsert(k); // DEBUG : System.out.println("Verifying minimum black edge count of tree for seed = " + i + " after red- edged insertion of " + k + " is " + rb.depth); assertEquals(rb.depth, llrb.minBlackEdgesDepth()); } } // Testing on unbalanced red black trees for(int i =0; i <128; i++){ for(int k =0; k <96; k++){ rb.resetRandomTree(i); int key = k /3*4+(k %3)+1; rb.bstInsert(key,false); // DEBUG : System.out.println("Verifying minimum black edge count of tree for seed = " + i + " after black- edged insertion of " + k + " is still " + rb.depth); assertEquals(rb.depth ==0?1: rb.depth, rb.toLLRB(). minBlackEdgesDepth()); } } } privatevoid testMaxBlackDepth(){ LLRB llrb; // Testing on balanced red black trees for(int i =0; i <128; i++){ llrb = rb.resetRandomTree(i); for(int k =0; k <128; k++){ llrb.bstInsert(k); // DEBUG : System.out.println("Verifying maximum black edge count of tree for seed = " + i + " after red-
  • 6. edged insertion of " + k + " is " + rb.depth); assertEquals(rb.depth, llrb.maxBlackEdgesDepth()); } } // Testing on unbalanced red black trees for(int i =0; i <128; i++){ for(int k =2; k <96; k++){ rb.resetRandomTree(i); int key = k /3*4+(k %3)+1; rb.bstInsert(key,false); // DEBUG : System.out.println("Verifying maximum black edge count of tree for seed = " + i + " after black- edged insertion of " + k + " is " + (rb.depth + 1)); assertEquals(rb.depth +1, rb.toLLRB().maxBlackEdg esDepth()); } } } privatevoid testLeftRed(){ LLRB llrb; // Testing on valid red black trees for(int i =0; i <128; i++){ llrb = rb.resetRandomTree(i); // DEBUG : System.out.println("Checking validity of tree for se ed = " + i); assertFalse(llrb.containsConsecutiveLeftRedEdges()); } // Testing on invalid red black trees for(int i =0; i <128; i++){ for(int k =0; k <32; k++){ rb.resetRandomTree(i); rb.bstInsert(k *4+3,false); rb.bstInsert(k *4+2,true);
  • 7. rb.bstInsert(k *4+1,true); // DEBUG : System.out.println("Checking invalidity of tree for seed = " + i + " after inserting two edges on the left at " + (k * 4 + 2) + " and " + (k * 4 + 1)); assertTrue(rb.toLLRB().containsConsecutiveLeftRed Edges()); } } } privatevoid testRightRed(){ LLRB llrb; // Testing on valid red black trees for(int i =0; i <128; i++){ llrb = rb.resetRandomTree(i); // DEBUG : System.out.println("Checking validity of tree for se ed = " + i); assertFalse(llrb.containsRightRedEdge()); } // Testing on invalid red black trees for(int i =0; i <128; i++){ for(int k =0; k <32; k++){ rb.resetRandomTree(i); rb.bstInsert(k *4+1,false); rb.bstInsert(k *4+2,true); // DEBUG : System.out.println("Checking invalidity of tree for seed = " + i + " after inserting red edge on the right at " + (k * 4 + 2)); assertTrue(rb.toLLRB().containsRightRedEdge()); } } } privatevoid testIns(){ // Testing serial insertions into random red black trees
  • 8. for(int i =0; i <128; i++){ // DEBUG : System.out.print("For seed = " + i + " inserting key s :"); LLRB llrb = rb.resetRandomTree(i); for(int k =0; k <96; k++){ int key = k /3*4+(k %3)+1; // DEBUG : System.out.print(" " + key); llrb.insert(key); assertTrue(testValid(llrb)); assertNodes(llrb, rb.max, key); } // DEBUG : System.out.println(""); } } privatevoid testMethod(int method_id)throwsException{ try{ System.out.print(border + test + border); switch(method_id){ case0: testIns();break; case1: testRightRed();break; case2: testLeftRed();break; case3: testMaxBlackDepth();break; case4: testMinBlackDepth();break; case5: testFix();break; } }catch(AssertionError aerr){ ae = aerr; }catch(Exception err){ e = err; } if(ae !=null|| e !=null){ System.out.print("n"+ border + test + failed + border); System.out.println("failing case seed = "+ rb.seed +" and the co rresponding tree:");
  • 9. System.out.println(rb.toString()); if(ae !=null)throw ae; if(e !=null)throw e; }else{ System.out.print(border + test + passed + border); } } @Test publicvoid testFixLLRB()throwsException{ test ="* Testing fix LLRB *n"; testMethod(5); } @Test publicvoid testMinBlackEdgesDepth()throwsException{ test ="* Testing minimum black edges depth *n"; testMethod(4); } @Test publicvoid testMaxBlackEdgesDepth()throwsException{ test ="* Testing maximum black edges depth *n"; testMethod(3); } @Test publicvoid testContainsConsecutiveLeftRedEdges()throwsExcep tion{ test ="* Testing consecutive left red edges *n"; testMethod(2); } @Test publicvoid testContainsRightRedEdge()throwsException{ test ="* Testing right red edge *n";
  • 10. testMethod(1); } @Test publicvoid testInsert()throwsException{ test ="* Testing insert *n"; testMethod(0); COLLECTIVE BARGAINING EXERCISE (100 POINTS) I. READ THE FOLLOWING SITUATION AND CURRENT CONTRACT PROVISIONS. II. WRITE A PROPOSAL INDICATING WHAT YOUR TEAM INTENDS TO OBTAIN FOR EACH ISSUE. INCLUDE: >> WHAT DOES YOUR TEAM THINK IS A REASONABLE AMOUNT FOR EACH BARGAINING ISSUE? WHY?? >> WHAT ARE YOUR HIGH PRIORITY ITEMS? WHY?? >> WHAT ARE YOU WILLING TO TRADE IN EXCHANGE FOR YOUR HIGH PRIORITY ITEMS? WHY?? >> WHAT ISSUES IN ADDITION TO THE CURRENT CONTRACT PROVISIONS DO YOU PROPOSE? WHY??
  • 11. (PROPOSALS = UP TO 40 POINTS, DUE APRIL 21, 2016) III. NEGOTIATE A CONTRACT THAT IS ACCEPTABLE TO BOTH PARTIES. YOU MUST HAVE A CONTRACT SIGNED BY ALL NEGOTIATING MEMBERS BY CLASS TIME, MAY 3, 2016). IF AN IMPASSE IS REACHED HOWEVER, YOU MUST FULLY EXPLAIN WHAT YOUR SIDE IS PLANNING TO DO. A 25 POINT PENALTY IS ASSESSED IF THERE IS A STRIKE OR LOCKOUT. CONTRACTS WILL BE GRADED ON THEIR COMPLETENESS AND NEATNESS. (CONTRACTS = UP TO 25 POINTS) IV. EXPLAIN WHAT HAPPENED DURING YOUR NEGOTIATIONS. THIS REPORT SHOULD INCLUDE: A. WHAT WERE THE HARDER ISSUES TO NEGOTIATE? WHY? B. WHAT WERE THE EASIER ISSUES TO NEGOTIATE? WHY? C. BASED ON HOW THIS CONTRACT TURNED OUT, WHAT WOULD YOU ANTICIPATE HAPPENING WHEN IT EXPIRES? WHAT ISSUES DID YOUR SIDE WIN? LOSE? (BE SURE TO EXPLAIN WHY YOU WON OR LOST ISSUES.) HOW WILL THESE AFFECT FUTURE CONTRACT TALKS? WHY? (REPORT = UP TO 15 POINTS, DUE WITH THE CONTRACT, MAY 3, 2016 V. GROUP EVALUATION (20 POINTS BASED ON GROUP AVERAGE RATING) (GROUPS MAY DISCHARGE NONPERFORMING MEMBERS. TERMINATED MEMBERS WILL RECEIVE A "0" FOR THE PROJECT. DUE MAY 3, 2016)
  • 12. COLLECTIVE BARGAINING The Melville Printing Company is a seventy year old printing company located in a south central Kentucky. The company manufactures a wide variety of items including brochures, atlases, annual reports, and sales catalogs. Melville has always enjoyed a reputation for high quality and reliability in meeting delivery dates. The company employs 1241 skilled and semi- skilled employees in addition to about 160 management and staff personnel. The currently operate 24 hours per day, seven days a week. The employees rotate on two 12 hour shifts (7 am -7 pm and 7pm-7am). The work force, consisting mainly of graphic arts, printing, and typographical workers, was organized in 1966 by the International Brotherhood of Printers (IBP). Labor-management relations have generally been good, but some conflicts have resulted in the past few years. While the company has not been struck by IBP, the number of grievances and arbitration cases has risen substantially in the past three years. Historically, Melville held a sizeable share of the regional market and enjoyed impressive profit margins. However, recent competition has led to a gradual erosion in the past five years. Competition is expected to increase, causing a great concern for Melville's top management. The union has sympathized with Melville's recent sales situation, but has let it be known that they will fight for a considerably stronger contract than they presently have. The company is still profitable with a stable ROA of 4% and posted a net profit of $5,120,000 last year. However, Management feels that it cannot afford to liberalize the current contract to any significant extent. They may even look for possible reductions or more cost sharing with respect to benefits. The following reflects the current contract provisions. The additional information provided comes mostly from a recent pay survey of local employers considered to be in Melville’s
  • 13. relevant labor market. Last year’s total compensation for the non-exempt employees covered by the contract was: Hourly pay = $37,154,320 Overtime pay = $4,149,749 Benefits = $11,146,296 Your task is to negotiate a contract between the Melville Printing Company and IBP. CURRENT CONTRACT PROVISIONS ISSUE CURRENT CONTRACT PROVISIONS ADDITIONAL INFORMATION WAGES Average wage = $12.05 PER HOUR Range of $10.85 to $17.95 PER HOUR. Shift differential of $.30 for night shift. Wage rates for competing companies in the local area average $14.35/hour, with a range of $8.75 to $19.75. Shift differentials of shift, $.50 for nights. OVERTIME Premium pay of time and one half for all hours over 40 per week. Also receive premium rate for Sundays and Holidays. Each union employee averages 185 hours of overtime per year. LAYOFF NOTICE Minimum of 2 weeks advance notice for ANY layoff. Five of the competing companies give 30 days notice. Eleven
  • 14. others give 2 weeks. Another 6 companies surveyed give 60 days notice. VACATION Five days after 1 year of service. Ten days for all employees with 2+ years of service. Average union employee tenure at Melville = 8.5 years. Most (75%) competing companies offer the following: 2 weeks (10 days) after 1 year, 3 weeks after 10 years, and 4 weeks after 20 years. LUNCH Thirty minutes allowed for lunch/PAID. Competing companies vary widely: From 30 minutes unpaid up to 1 hour paid. BREAKS Two 10-minute breaks per 8 hour shift. Also 10 minutes for personal clean-up at end of shift (Paid). Competitors range from ten minute breaks to 20 minute breaks. HOLIDAYS Eight paid holidays (to be named in contract) Competitors average 9 paid holidays. BEREAVEMENT LEAVE NONE Competitors usually offer 3 days for immediate family. LAYOFF Need to determine the basis (e.g., seniority) for any layoffs and other policy issues Research this one. SICK LEAVE Receive one half day per month or 6 paid sick days per year.
  • 15. No carry over. Among competing firms: 5 have 6 days per year, 8 have 12 per year, and 7 have no paid sick leave. FMLA Negotiate a FMLA policy Federal law mandates 12 weeks unpaid. SUPPLE- MENTAL UNEMP. BENEFITS NONE SUB would cost the company an estimated $1000 per employee per year. HEALTH CARE Company pays $405/month premium per employee for major medical coverage with 80/20 co-pay with a maximum deductible of $3000. Family coverage available at employee's expense ($275/month premium). 27% of the competing companies pay for family coverage. Most use the 80/20 co-pay system for major medical with maximum deductibles ranging from $500 to $6000. EAP NONE Research this one. DENTAL CARE NONE If company pays, would cost $120 per employee with $100 deductible. Family coverage costs an additional $180 per employee per year., PROFIT SHARE NONE
  • 16. (Provide all important details for any proposed plan!) If current profit levels are maintained, typical payments to each employee would be about $300 per year with a 25/75 split. Two competitors offer gainsharing incentives. GRIEVANCE PROCESS NONE SPECIFIED IN CONTRACT, Employees register complaints with an elected union steward who negotiates with management personnel. Most other union contracts specify procedures. PENSION NONE (Provide all important details for any proposed plan!) Melville is the only company in the area that doesn't have some form of pension plan. OTHER ISSUES: TBA YOUR OPPORTUNITY FOR ADDITIONAL RESEARCH CONTRACT LENGTH Three years Among competing unionized companies: Three have 3 year contracts, two have 2 year contracts, an one has a 1year Each part will be graded using the following scale: A= Demonstrates complete understanding of all concepts. Shows insights and initiative by providing information beyond the text and this handout. Accurately cites all outside research. B= Demonstrates complete understanding of all but a few concepts. Shows evidence of work beyond the minimum requirements. C= Demonstrates basic understanding of most key concepts. Provides answers to the parts based mainly on the text and this
  • 17. handout. Limits contract coverage to issues currently stated. D= Demonstrates confusion on some key concepts, and/or evidence of minimal effort. Employees would probably raise many questions with the contract. F= Unacceptable work due to confusing explanations of key concepts, major omissions, or other errors which demonstrates a lack of understanding of the concepts or lack of effort.