TEORI STRUKTUR DATA
Array and
Struct
Dosen :
ZHURI HALIM
Disusun
oleh :
Paisal Patopang /1703015048
Paisal Patopang /1703015048
Muhamad Haikal Amirullah /1703015005
Pandiya Tanowijaya /1703015080
Wisnu Ardiansyah /170301509
Syafira Zakiyah /1703015043
Ammar / 1703015055
Gilang Agensi/1703015099
Gilang Agensi/1703015099
PROGRAM
STUDI TEKNIK INFORMATIKA
FAKULTAS
TEKNIK
UNIVERSITAS
MUHAMMADIYAH PROF. DR. HAMKA
2018
BAB I
Abstrak
Array :
Makalah ini menyajikan perangkat lunak open source baru, melakukan analisis dataflow yang bijaksana
skalar dan referensi array. Perangkat lunak
ini merupakan implementasi C ++ dari Analisis Data Aliran Array Fuzzy (FADA)
metode. Metode ini dapat diterapkan pada
kode dengan kontrol tidak teratur seperti while-loop, jika-kemudian-lain atau
akses array non-reguler, dan analisis
data-bijaksana analisis alur data yang akurat. Asfarasweknow,adalah yang pertama dirilis open source C +
+ pelaksanaan penanganan ketergantungan data-contoh yang bijaksana
kelas program yang lebih besar. Selain itu,
perpustakaan secara teknis independen dari kompiler yang ada; Bisa jadi
dicolokkan dari mereka, artikel
iniberhasilmengandungpadainandalampengaturan di dalam gcc / GRAPHITE.Wegive
rincian tentang implementasi perpustakaan
dan kemudian melaporkan beberapa hasil awal dengan gcc dan kemungkinan
penggunaan untuk penelusuran
penjadwalan
pada kode yang tidak beraturan.
Struct :
Definisi Struktur (struct) sendiri
adalah kumpulan dari variabel yang dinyatakan dengan sebuah nama , dengan sifat
setiap variabel dapat memiliki tipe yang berlainan.
Dalam pemrograman C++, jika kita
membuat suatu program yang memerlukan berbagai tipe data yang akan digunakan.
Tentunya dengan nama variable yang banyak pula. Dalam program yang sederhana,
jika kita manggunakan sedikit variable tentu tidak jadi masalah. Akan tetapi
jika kita akan membuat sebuah program yang lebih kompleks, dengan berbagai
macam nama dan tipe variable dalam pendeklarasianya. Dengan struct, kita bisa
mengelompokkan berbagai nama dan tipe variable tersebut sesuai dengan
kelompoknya. Hal ini tentunya bisa berguna untuk memudahkan dalam
mengelompokkan sebuah variable.
BAB II
Teori
Array :
In implementing complex programming systems
for finite element computations, the analyst is usually faced with the
challenge of transforming complicated tensorial formulae to a matrix form. Considerable
amount of time in solving problems by the finite element method is often
devoted to the actual implementation process. If one decides to use FORTRAN, a
number of finite element and numerical libraries are readily available.
Although quick results can be produced in solving simpler problems, when
implementing complex small deformation elastoplastic or large deformation
elastic and elastoplastic algorithms, C++ provides clear benefits.
Some of the
improvements C++ provides over C and FORTRAN are classes for encapsulating
abstractions, the possibility of building user—defined concrete data types and
operator overloading for expressing complex formulae in a natural way. In the
following we shall show that the nDarray tool will allow analysts to be a step
closer to the problem space and a step further away from the underlying
machine.
As most
analysts know, the intention( 15) behind C++ was not to replace C.
Instead, C was extended with far more freedom given to the program designer and
implementor. In C and FORTRAN, large applications become collections of
programs and functions, order and the structure are left to the programmer. The
C++ programming language embodies the OOP, which can be used to simplify and
organize complex programs. One can build a hierarchy of derived classes and
nest classes inside other classes. A concern in C and FORTRAN programming
languages is handling data type conflicts and data which are being operated on
or passed. The C++ programming language extends the definition of type to
include abstract data types. With abstract data types, data can be encapsulated
with the methods that operate on it. The C++ programming language offers
structure and mechanisms to handle larger, more complex programming systems.
Object Oriented technology, with function and operator overloading, inheritance
and other features, provides means of attacking a problem in a natural way.
Once basic classes are implemented, one can concentrate on the physics of a
problem. By building further abstract data types one can describe the physics
of a problem rather that spend time on the lower level programming issues. One
should keep in mind the adage, credited to the original designer and
implementor of C++ programming language, Bjarne Stroustrup: "C makes it
easy to shoot yourself in the foot, C++ makes it harder, but when you do
it blows away your whole leg"


Example :
Table :
Arrays of Strings .
An array of strings is a special form of a two-dimensional array.
• The size of the left index determines the number of strings.
• The size of the right index specifies the maximum length of each
string.
For example, the following declares an array of 30 strings,
each
having a maximum length of 80 characters (with one extra character
for the null terminator):
char string_array[30][81];
For accessing an individual string, one simply specifies only the left
index:
firstString = string_array[0];
sixthString = string_array[5];
The following example calls the gets() function with the third string
in the array:
gets(string_array[2]);
excample :
This program accepts lines of text entered at the keyboard and
redisplays them after a blank line is entered.
// includes go here
int main()
{
int t, i;
char text[100][80];
for(t=0; t<100; t++) {
cout << t << “: “;
gets(text[t]);
if(!text[t][0]) break; // quit on blank line
}
for(i=0; i<t; i++) // redisplay the strings
cout << text[i] << ‘\n’;
return(0);}
Struct :
Definition Structure (struct) itself is a collection of variables
associated with a name, with characteristics that have different types.
In C ++ programming, if we create a program that connects various data to
be used. Of course with many variable names as well. In a simple program, if we
use a few variables, it does not matter. However, if we will create a more
complex program, with various names and variables in the declaration. With
structs, we can group various names and types of variables in accordance with
the group. This allows to facilitate in grouping variables.
In declaring a struct, there are some usual inherent ways.
First:
Example :
struct
name_struct {
tipe_data_1
nama_var_1;
tipe_data_2
nama_var_2;
tipe_data_3
nama_var_3;
};
The second is by using typedef declarations.
typedef struct {
type_data_1 nama_var_1;
type_data_n nama_var_n;
} nama_struct;
Then to declare a variable with the
previously created struct data type is:
struct tipe_struct nama_variabel;
If the declaration of a struct previously
uses a typedef, then to declare a variable with a data type struct is:
type_struct variable_name;
And to access a struct is to use the operator
point (.)
nama_var_struct. nama_var_elemen;
NESTED STRUCT
In a struct there can be a struct again. So this can be interpreted struct in the struct. Almost like a nested loop, that is for inside a for.
Example:
struct date {
int day;
int month;
int year;
};
struct employee {
char NIP [10];
char name [20];
struct date tgl_masuk;
float salary;
};
STRUCT OF ARRAY :
A struct in which there is a variable with an
array data type.
Example:
struct data {
char name [20];
char address [100];
};
0 komentar:
Posting Komentar