Showing posts with label array. Show all posts
Showing posts with label array. Show all posts

Wednesday, February 16, 2011

Blog Replacement 01302011 :: Class Reflection

This is a replacement blog for 01302011 Class Reflection.

This week, we worked on Sort/Search. This takes an array and organizes it from least to greatest. If you want it to be the other way around, then you can just arrayName.reverse(). This is really useful because it makes the arrays really have a purpose. You could not take 4 different integers that aren't in an array and organize them by greatest to least. Arrays are really useful for this reason.

Search is also helpful, as you can find the location of a data point after you sort the array in any way you choose. Sort/search really makes arrays useful.

Wednesday, February 2, 2011

Reflection 01232011

This week we are working with Array Lists. An arraylist is just an array with the capacity to add or remove array spaces. Unlike plain old arrays, you do not have to initiate the array while defining a size. With an array, you have a set grid of numbers which are then called by whatever you are doing. In ArrayLists, you can make the code add more numbers and spaces in the ArrayList, as well as take them away. These Array Lists are useful because say you had a growing database of information, and didn't want to create a directory too small to contain all of the information you would have in the future. Creating a method using an Array List will enable the program to make new information storing places, as well as remove old information that you have no need for any more.