Science Fair Projects Ideas - Array slicing

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

Array slicing

In computer programming, array slicing is an operation that extracts certain elements from an array and packages them as another array, possibly with different number of indices and different index ranges. Two common examples are extracting a substring from a string of characters (e.g. "kipe" from "wikipedia"), and extracting a row (or a column) of a rectangular matrix to be used as a vector.

Depending on the language and context, the elements of the new array may be aliased to (i.e., share memory with) those of the original array.

Slicing vectors and strings

For "one-dimensional" (single-indexed) arrays — vectors, sequence, strings etc. — the most common slicing operation is extraction of zero or more consecutive elements. Thus, if we have a vector containing elements (2, 5, 7, 3, 8, 6, 4, 1), and we want to create an array slice from index 2 to 5, we get (7, 3, 8, 6).

In the Perl programming language, which allows arrays to be sliced easily, if we have

@x = (2, 5, 7, 3, 8, 6, 4, 1)

as above,

@x[2..5]

will represent the sliced array (7, 3, 8, 6).

History

The concept of slicing was surely known even before the invention of compilers. Slicing as a language feature probably started with the FORTRAN, more as a consequence of non-existent type and range checking than by design. Fortran 90 and Kenneth Iverson's APL provide very flexible multi-dimensional array slicing, which contribute much to the languages' expressive powers.

10-26-2009 08:16:03
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice