User:Brian P. Josey/Notebook/2010/08/10: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
Line 16: Line 16:
* '''Index Array''' will return the elements, or a sub-array of another array at an index,
* '''Index Array''' will return the elements, or a sub-array of another array at an index,


 
==Clusters==
Clusters are similar to arrays in that they bundle different pieces of data together, but are different in that arrays only bundle together data of the same type, while a cluster generalizes this to several different types of data. While an array could be thought as a dictionary, containing only the definitions for words, a cluster would be a multiple subject notebook, with notes on physics, history and French cuisine on different pages.


<!-- ##### DO NOT edit below this line unless you know what you are doing. ##### -->
<!-- ##### DO NOT edit below this line unless you know what you are doing. ##### -->

Revision as of 14:24, 10 August 2010

Project name <html><img src="/images/9/94/Report.png" border="0" /></html> Main project page
<html><img src="/images/c/c3/Resultset_previous.png" border="0" /></html>Previous entry<html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</html>Next entry<html><img src="/images/5/5c/Resultset_next.png" border="0" /></html>

Arrays

Arrays are groups of data elements that have are composed of the same type. Each array consists of the elements, and dimensions that specify the number of elements possible and their orientation in respect to how they are stored. They are ordered and can be indexed. A simplified example on how to create an array, is to generate a string of random numbers, and organize them into the array. To do this, you could simply create a for loop that generates a random number, and output it to an array. To create a two dimensional array, nest a for loop into another. The inner loop will create the columns, while the outer loop will create the rows.

Several important functions that can act on an array are:

  • Array Size which gives the size of the array,
  • Initialize Array will create an array that each element is initialized to a value,
  • Array Subset will return a portion of an array, starting at an index,
  • Build Array will concatenate two or more arrays into one,
  • Index Array will return the elements, or a sub-array of another array at an index,

Clusters

Clusters are similar to arrays in that they bundle different pieces of data together, but are different in that arrays only bundle together data of the same type, while a cluster generalizes this to several different types of data. While an array could be thought as a dictionary, containing only the definitions for words, a cluster would be a multiple subject notebook, with notes on physics, history and French cuisine on different pages.