From f17a23c4217d43fd2b6d1bd563d49656f6c0aa3a Mon Sep 17 00:00:00 2001 From: Yuliya-Kaleda Date: Thu, 28 May 2015 20:59:05 -0400 Subject: [PATCH 1/2] finished assignment --- .idea/.name | 1 + .idea/compiler.xml | 23 + .idea/copyright/profiles_settings.xml | 3 + .idea/encodings.xml | 4 + .idea/libraries/jdk1_7_0_75.xml | 9 + .idea/libraries/jdk1_7_0_751.xml | 9 + .idea/libraries/lib.xml | 10 + .idea/misc.xml | 227 ++++++ .idea/modules.xml | 8 + .idea/scopes/scope_settings.xml | 5 + .idea/vcs.xml | 6 + .idea/workspace.xml | 667 ++++++++++++++++++ .../Exercises$Child.class | Bin 0 -> 584 bytes .../Exercises$Parent.class | Bin 0 -> 425 bytes .../Exercises.class | Bin 0 -> 355 bytes .../unit-1-bootcamp-assessment/MyNode.class | Bin 0 -> 1929 bytes .../unit-1-bootcamp-assessment/MyObject.class | Bin 0 -> 762 bytes .../MyObjectNode.class | Bin 0 -> 1081 bytes .../unit-1-bootcamp-assessment/Tests.class | Bin 0 -> 3888 bytes src/Exercises.java | 15 +- src/MyNode.java | 32 +- src/MyObject.java | 33 + src/MyObjectNode.java | 55 ++ unit-1-bootcamp-assessment.iml | 12 + 24 files changed, 1113 insertions(+), 6 deletions(-) create mode 100644 .idea/.name create mode 100644 .idea/compiler.xml create mode 100644 .idea/copyright/profiles_settings.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/libraries/jdk1_7_0_75.xml create mode 100644 .idea/libraries/jdk1_7_0_751.xml create mode 100644 .idea/libraries/lib.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/scopes/scope_settings.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 out/production/unit-1-bootcamp-assessment/Exercises$Child.class create mode 100644 out/production/unit-1-bootcamp-assessment/Exercises$Parent.class create mode 100644 out/production/unit-1-bootcamp-assessment/Exercises.class create mode 100644 out/production/unit-1-bootcamp-assessment/MyNode.class create mode 100644 out/production/unit-1-bootcamp-assessment/MyObject.class create mode 100644 out/production/unit-1-bootcamp-assessment/MyObjectNode.class create mode 100644 out/production/unit-1-bootcamp-assessment/Tests.class create mode 100644 src/MyObject.java create mode 100644 src/MyObjectNode.java create mode 100644 unit-1-bootcamp-assessment.iml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..540cdbc --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +unit-1-bootcamp-assessment \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..a852314 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..d821048 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/jdk1_7_0_75.xml b/.idea/libraries/jdk1_7_0_75.xml new file mode 100644 index 0000000..8614d03 --- /dev/null +++ b/.idea/libraries/jdk1_7_0_75.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/jdk1_7_0_751.xml b/.idea/libraries/jdk1_7_0_751.xml new file mode 100644 index 0000000..4766e86 --- /dev/null +++ b/.idea/libraries/jdk1_7_0_751.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml new file mode 100644 index 0000000..85d6a10 --- /dev/null +++ b/.idea/libraries/lib.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..da097ba --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + 1.7 + + + + + + + + jdk1.7.0_75 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..8928d91 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..cc39bf5 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,667 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1432856430832 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No facets are configured + + + + + + + + + + + + + + + 1.7 + + + + + + + + unit-1-bootcamp-assessment + + + + + + + + 1.7 + + + + + + + + jdk1.7.0_75 + + + + + + + + \ No newline at end of file diff --git a/out/production/unit-1-bootcamp-assessment/Exercises$Child.class b/out/production/unit-1-bootcamp-assessment/Exercises$Child.class new file mode 100644 index 0000000000000000000000000000000000000000..2df8147a78ca0a7e425b9531d1f8c781247a4875 GIT binary patch literal 584 zcmZutO;5r=6r80kEm#pMqWBdL#(;@(@Zdq?g=jQsj0uMO(k`&3wn-^|{3|_~c<=}K zql|A`L?X87&U>>neY5-d_5K0i2-`&%s99LGux4W2#0EqDRE9D+W6&DSE`#2Ve8I5f z%1~U7?|UM?<-LFy$BjH5ba^aQKOyyGC`SxNdnf~+!M+MZ5w`^0`ue}#-DIP+SDVka8Mp16=Ic4->n zPz|$@he?6GEU05CF&>x%Csu;0in`qPVR+Z)@sjKwHa$=Vm&6zrB>~) jwVYaO+4jV$Vmnw)P1SVN3Kj_+Qt7BuMvIPD$0n?A=2&TT literal 0 HcmV?d00001 diff --git a/out/production/unit-1-bootcamp-assessment/Exercises$Parent.class b/out/production/unit-1-bootcamp-assessment/Exercises$Parent.class new file mode 100644 index 0000000000000000000000000000000000000000..0a403bd8bddf4bee046453faead39e93eb9727e5 GIT binary patch literal 425 zcmYjNO;5r=6r6350-|8WkD~_!alD{h2n6FS z&Wp)JpwsO|Gx;j}sWj7moLgXX#-rt^SkxOR0x;$=abMi1GW;!6s^dI>k?a literal 0 HcmV?d00001 diff --git a/out/production/unit-1-bootcamp-assessment/Exercises.class b/out/production/unit-1-bootcamp-assessment/Exercises.class new file mode 100644 index 0000000000000000000000000000000000000000..1b5bc7e618f89c04cca38043d25b6ea4cbe52915 GIT binary patch literal 355 zcmYLFO-sW-5Pj1oO`66g#;>#BK|R<*kBXO|AOsbZ-Z$xDx5N!>(&FFpBzW)#_@j!m zX^Fe+%$qlFhME1{eE$HL;v_&HiH8FZhaQdyZn{wAoDe=}ElpaAx|X$vW5VEB7^xcu zH%hDKme4=Hm=T<`noB~IDJ>sY@3}OuA}^UqvZ@f}Oc-V39qBX+RTDM+`46mCTrBWg8qYxgl=pRm^9=fa1_-iQAOENw>b literal 0 HcmV?d00001 diff --git a/out/production/unit-1-bootcamp-assessment/MyNode.class b/out/production/unit-1-bootcamp-assessment/MyNode.class new file mode 100644 index 0000000000000000000000000000000000000000..df6a76f0ca132672e5fdd0fb2ef22806ea82f731 GIT binary patch literal 1929 zcmZuyT~pgu5Iq;mmTd$9$3RLTg`{l^E}=~m+JujgkJ8c_NMn~Yp3gTsvyvU`kO$wp_uSR)*|RJ8@BjYz6Tl}pNMjT$X}p6k z#QIXKRaw50~C9s$=r5`WC~u{bT&=j zmU9c#f?d0=Fx-82SZm++wb(5%)e@8GRVyfjywka<6Xr?64(;i07sv z-nLt}e3sjrYX=hk1MO3kQlMnna|4s^3PZWmA*UYGrS9!pQCh`gUokMtPu9#@tIR}> zDaB9QXB^g>+vJ&8>7k5TfGF$&?A|iuU@&O4@F)8TF7a61&)0^CXVZS zL~e6e+~dws0*we$f6fR=)(v#I7fUGH>lVe)skYTBRZ{ONetIR z^=?qJ^Oz&uHU2-0(~3c)7$zcKmq95)>pC@7_>^`QslJiHW%VyIO4g)`Ew^R)3@PTl zNl%gCDC`?hdI|l}3;vJfwIigONI%SHdc&>v2u5hcn&|rr{Y{)%%xj@Nu>Ly+Un0W? z&yF>b%?vd$Ji}iTBTbx>ruKyOUqq6&td}szyi)xnna{A2Ir1;E`V$RGn8yPBlPF*j eOJq7j-&rUh;$E2N^Zx;|)tp@b literal 0 HcmV?d00001 diff --git a/out/production/unit-1-bootcamp-assessment/MyObject.class b/out/production/unit-1-bootcamp-assessment/MyObject.class new file mode 100644 index 0000000000000000000000000000000000000000..719b9385eca1178c0f9c99e28a55a2c0999bfeb9 GIT binary patch literal 762 zcmZ{gQA+|r6ot?1uB&cqnyHmq+M62WLyv_JK@gZd6he=yEw-X7*c$YodMHSO9{K_O zsOZeBCS|cOJ9FopbHBMCpKtE~4zOz>fQwh0H s^^IiCkOZ<+EQ9Eezd-VTf^1-O38e62Mj=RvAmx8Rfd(*OVf literal 0 HcmV?d00001 diff --git a/out/production/unit-1-bootcamp-assessment/MyObjectNode.class b/out/production/unit-1-bootcamp-assessment/MyObjectNode.class new file mode 100644 index 0000000000000000000000000000000000000000..ae1e406a1ebc9942e618b0589155dee1d0acef90 GIT binary patch literal 1081 zcmZ`%O>fgc6r6ROIC0#hb<;F_L(7NbKvM+bQq&6w2`McSMZIrQlez>4IWDNbh$~1? zBo17W_)&=2wTmLxy}W(z?aVyyJpcLo^A~_e*tAi@y&9_UROqVU+YCJw?yK7e7B(#O z1xhkH5fCp0Do?{GOt#tby88m=v*|$~&>VzOuzUP|7{qVnaKer|n2zLRU&f)Tv!OEQt9!Fp@A~>ltMd2WeUWr_fSJ%wOFf^*K(<~e1R5i(OQ>qx#+vhyjGi9 zs~2d|U9ClfGp)X^l}X=VeBonKlPYY3;39)=6p~AM@>(JJCfAm(XMVDoCwqlt{tX#< zn60McpQ8L5b-#Ct%4eP|nOe$}l3usVMFX3#@R0RmTJvPioX-EHb+E3DzD=|VqiJ!{ J9p(n^{sTfzkCFfY literal 0 HcmV?d00001 diff --git a/out/production/unit-1-bootcamp-assessment/Tests.class b/out/production/unit-1-bootcamp-assessment/Tests.class new file mode 100644 index 0000000000000000000000000000000000000000..a94d975c3dac474c575d1c2c6ac1845059ae467d GIT binary patch literal 3888 zcmbVPTX!2*8Qo(^p7D5`I`SozouqN&B=RM3>!bmk3l)yjC`d|(Oj@^ub}WspNu-fG zGfHfFg{G8ixwhq6palwr1X{rHBCB0I^U7a<|InwFeP%|ZvE#G_uVtOvcfN0*z4tk? z|M~vk-vw|GYby4lEMq}M8_Eh6MO#r};-ZR6sES@qh9w3|Dmp~W;|gribyT=$D7Y-z zD=KzlS;mTJza--c6@4hHcoI*E-qSLkQShvSFDv+pNcNn9s|uc1@KpsbDEOL;uXo@Z z_@>zYEg9cd@S@7`cT{{A-;?ou3GGKs%XE)Rh^0r)ON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2sIzGo5F=AW5 zITVRk&@UX_$^R|xhoIkIo8{W)xi*IQ2Lz(XI4|Qt84t;rlkqS=C0@+;u=9Ovm+^=s zy+<3~PPs3H%KeMLg>u(@<#q-Z`@fWvedX>F%Iy-$4Hf6wlXrh?`Nk9PVE0_C2PtNF z8^gs_?BUd2x?vw@x+m9==G@3sq9ybsy$W9GI4@Nv3GSw^QzUMZu0F!H|hhGM@Siv4OR_Dg}-*Lcq^5Mv@DyNLH? w7g7I%>_Z { - private MyNode left; - private MyNode right; - private T data; + protected MyNode left; + protected MyNode right; + protected T data; public abstract MyNode getLeft(); @@ -13,6 +15,7 @@ public abstract class MyNode { public abstract T getData(); public abstract void insert(MyNode newNode); + public boolean contains(T someData){ if(getData()==null && someData == null){ return false; @@ -23,6 +26,29 @@ public boolean contains(T someData){ boolean left = getLeft()!=null ? getLeft().contains(someData) : false; boolean right = getRight()!=null ? getRight().contains(someData) : false; + + +// if ( getRight()!= null) { +// right = getRight().contains(someData); +// } +// else { +// right = false; +// } + + + return left || right; } + + public static void main(String[] args) + { + ArrayList l = new ArrayList(); + l.add(1); + l.add("hello"); + l.add(0.0f); + + int value = (Integer) l.get(0); + String value2 = (String) l.get(1); + System.out.println(value + " " + value2 ); + } } diff --git a/src/MyObject.java b/src/MyObject.java new file mode 100644 index 0000000..f390856 --- /dev/null +++ b/src/MyObject.java @@ -0,0 +1,33 @@ +/** + * Created by July on 5/28/15. + */ +public class MyObject +{ + private String name; + private int age; + + public MyObject(String name, int age) { + this.name = name; + this.age = age; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public int getAge() + { + return age; + } + + public void setAge(int age) + { + this.age = age; + } +} diff --git a/src/MyObjectNode.java b/src/MyObjectNode.java new file mode 100644 index 0000000..c995952 --- /dev/null +++ b/src/MyObjectNode.java @@ -0,0 +1,55 @@ +import java.util.Random; + +/** + * Created by July on 5/28/15. + */ +public class MyObjectNode extends MyNode +{ + private int any; + + public MyObjectNode() { + } + + public void setLeft(MyNode left) { + this.left = left; +} + + public void setRight(MyNode right) { + this.right = right; + } + + public void setData(Object data) { + this.data = data; + } + + @Override + public MyNode getLeft() + { + return left; + } + + @Override + public MyNode getRight() + { + return right; + } + + @Override + public Object getData() + { + return data; + } + + @Override + public void insert(MyNode newNode) + { +// Random r = new Random(0); +// if (r.nextBoolean()) + if (this.getLeft() == null){ + this.setLeft(newNode); + } + else { + this.getLeft().insert(newNode); + } + } +} diff --git a/unit-1-bootcamp-assessment.iml b/unit-1-bootcamp-assessment.iml new file mode 100644 index 0000000..fb8e866 --- /dev/null +++ b/unit-1-bootcamp-assessment.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file From dda257d7e489ed3e0d956d32f67e5c600e01ef09 Mon Sep 17 00:00:00 2001 From: Yuliya Kaleda Date: Thu, 28 May 2015 21:01:09 -0400 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c02997c..c94c07b 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Test Start time: Thu May 28, 7:00pm EST -My End time: `` +My End time: 9pm Test End time: Fri May 29, 10:00pm EST