Thursday, September 6, 2012

Data Structure

1. Introduction Data Structures
Data structure is an organizational scheme, such as structures and arrays, which
applied to the data so that data can be interpreted and thus operation can be implemented on specific data.
 
2.Introduction to Algorithms
The algorithm is a sequence of steps that transform the basic calculation
input (from a mathematical function) to be output.
Example:
􀂃 Multiplication
Input: positive integers a, b
Output: a X b
Multiplication algorithm:
Case in point: a = 365, b = 24
Method 1: 365 * 24 = 365 + (365 * 23)
= 730 + (365 * 22)
.....
= 8760 + (365 * 0)
= 8760

3. Array
Array is an organization of homogeneous data set size or the number of elements maximum has been known from the beginning. Arrays are generally stored in computer memory are contiguous (sequential). Declaration of the array is as follows:
int A [5]; means that the variable A is a data set as much as 5 number of type integer.
 
Operation of the elements in the array is done by direct access. Value at each element position can be taken and the value can be stored without passing other positions. There are two types of operations, namely:
1. Operation of an element / position of the array
2. Operation of the array as a whole
 
The two most basic operations of an element / position is
A. The storage element to a specific position in the array
2. Capture the elements of a particular position in the array

 
4. Structure
The structure is a collection of variables declared with a name, the nature of each variable can have different types. Structure commonly used to classify some information relating to a single unity. Example of a structure is information on the data, which contains: date, month and year.

No comments:

Post a Comment