Skip to content

Commit 305c9cf

Browse files
committed
Merge branch 'master' of https://github.com/bhoffman0/CSAwesome
2 parents fc3b1c4 + 49d596e commit 305c9cf

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

_sources/Unit7-ArrayList/topic-7-4-arraylist-algorithms.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ In the last lesson, the coding challenge involved finding pairs. You should be a
433433
if (a[i] == a[j])
434434
{ #paired
435435
=====
436-
return true;
436+
return true;
437437
=====
438438
} // end if
439439
=====
@@ -598,10 +598,10 @@ We can write code that shifts or rotates elements left or right in an ``ArrayLis
598598
{
599599
// instantiate ArrayList and fill with Integers
600600
ArrayList<Integer> values = new ArrayList<Integer>();
601-
int[] nums = {1, 5, 7};
602-
for (int i = 0; i < nums.length; i++)
601+
int[] arrnums = {1, 5, 7};
602+
for (int i = 0; i < arrnums.length; i++)
603603
{
604-
values.add(nums[i]);
604+
values.add(arrnums[i]);
605605
}
606606
rotateLeft(values);
607607
System.out.println("Expected Result: [5, 7, 1]");
@@ -618,7 +618,6 @@ We can write code that shifts or rotates elements left or right in an ``ArrayLis
618618

619619
public class RunestoneTests extends CodeTestHelper
620620
{
621-
@Test
622621
public RunestoneTests()
623622
{
624623
super("TestRotate");
@@ -642,19 +641,20 @@ We can write code that shifts or rotates elements left or right in an ``ArrayLis
642641
assertTrue(passed);
643642
}
644643
@Test
645-
public void test2()
646-
{
644+
public void test2()
645+
{
647646
ArrayList<Integer> list = new ArrayList<Integer>();
648647
list.add(2);
649648
list.add(4);
650649
list.add(0);
651650
list.add(-2);
652651
String expect = "[4, 0, -2, 2]";
653-
String output = "" + TestRotate.rotateLeft(list);
652+
TestRotate.rotateLeft(list);
653+
String output = "" + list;
654654
boolean passed = getResults(expect, output, "rotateLeft with list 2,4,0,-2");
655655
assertTrue(passed);
656-
}
657-
}
656+
}
657+
}
658658

659659
Reversing an ``ArrayList``
660660
-----------------------------

0 commit comments

Comments
 (0)