Data structures are ways to save or represent data in the computer to be used efficiently. While the data is a representation of the real world facts. Facts or information about a reality that is stored, recorded or represented in the form of text, sound, images, signals or symbols.
Broadly speaking, the types of data can be categorized into:
Simple data type. Single simple data types,
such as integer, real, boolean and character.
Simple data type compound, misalnyaString
Data Structures, including: simple data structures, such as arrays and records.
Compound data structure, which consists of: Linear: Stack, Queue, and Multilist sertaList Non Linear: Binary Tree and Graph
The use of appropriate data structures in the programming process would result in an algorithm that is more clear and precise, so make the overall program more efficient and simple.
Standard data structure that is typically used in the field of informatics is:
* Listed linear (Linked List) and its variations
* Multilist * Stack (Stacks)
* Queue (Queue)
* Tree (Tree)
* Graph (Graph)
2.STACK
Understanding Stack or stack is a data structure that is important in programming that have the nature of a LIFO (Last In First Out), the last thing into the stack will be the first thing that is removed from the stack.
Stack (Piles) is a linear list of elements identified peak (TOP) and Rule insertion and deletion of certain elements. The insertion is always done "on top" TOP and Removal is always done at TOP
OPERATION-OPERATION / STACK FUNCTION Push: used to add an item on the stack on top of the pile
Pop: used to retrieve items on the stack on top of the pile
Clear: used to empty the stack
IsEmpty: function used to check whether the stack is empty
IsFull: function used to check whether the stack is full
3 QUEUE
Queue or queue on Data Structure is a set of data which additional elements can only be done on a tip called sisibelakang (rear), and removal (collection elements) is done through the other end (called the front side or front).
Queue or queue principle used is "First In First Out" or FIFO (First In First Out).
Queue or queue we encounter in everyday life, ex: Cars queue diloket Tol, students Queue Up, etc.. Another example is the use of computers in the field of computer systems to share time (time-sharing computer system) in which there are a number of users who will use the system simultaneously.
There is a queue or a queue at the entrance of the fruit in a fruit one end and exit at the other end where the need variables Head and Tail (front / front, rear / rear).
Characteristics Queue or queue:
1 element of the queue
2 front (leading elements of the queue)
3 tail (last element)
4 the number of elements in the queue
5. Operations on Queue status queue or queue
1.-added (add items to the back of the queue)
2. delete (remove the front element of the queue)
3 empty (detect whether the queue contains elements or not)
Queue operations:
1 Create () to create and initialize Queue way to make Head and Tail = -1
2 IsEmpty () To check if the queue is full or not the way to check the value Tail, Tail = -1 if it is empty Head We do not check, because the Head is a sign to the head of the queue (the first element in the queue) that will not change movement occurs with the addition of the Queue Queue elements backward, use the value that is Tail.
3 IsFull To check whether the queue is full or not by checking the value of the Tail, if
Tail> = MAX-1 (due to MAX-1 is the limit of the array elements in C) means it's full
4. Enqueue To add elements to the Queue, the addition of elements being added in the rear addition of the element element is always moving variables by means of increment counter Tail Tail advance
5. Dequeue () Used to remove the leading element / first (head) of the queue to shift all the way forward and reduce the queue elements Tail with 1 Shifting is done by using looping.
6 Clear () To remove queue elements by creating Tail and Head = -1 Deletion Queue elements are not actually delete the array, but only accessing its index set to a value of -1 so that queue elements are no longer legible
7 Shown () To display the values of the elements of Queue Using looping head s / d tail
4. SORTING
Sorting is the process of developing one element - the element with a particular sequence and process governance are implemented in a variety of applications. Let's take the example of the banking application. The application is able to display a list of active accounts. Almost all users on the system will choose the display list in ascending sequence for the sake of convenience in data retrieval. Some kind of sorting algorithm has been made because the process is very basic and often used. Therefore, an understanding of the algorithm - an algorithm that is extremely useful.
1.Selection Sort (Ascending): Ordering is done by selecting the largest element and put into position, then look for the next largest element and put in place, and so on.
The process of sequencing by using the method of selection sort in sequence up is:
1 Finding the smallest of data from the first data to recent data, kemunian in exchange position with the first data.
2 looking for the smallest of data from the second data to the latest data, then the data exchange with the second position.
3 seek third smallest data from the data until last data, then the data exchange with third position
4 and so on until all the data also rises. if there are n pieces of data that will sort, hence requiring a (n - 1) step sequencing, which latest data is data-n does not need to sort because only lived in one of them.
2 The concept of Buble Sort Bubble Sort Bubble Sort Method (Bubble Sort) inspired by soap bubbles on the surface of the water. Because the specific gravity of soap bubbles are lighter than the density of water, then soap bubbles always float to the surface. The above principle is used in bubble sort. Bubble sort (bubble method) is a method / sorting algorithms with by way of exchange of data with continuous right up next to them can be ascertained in a particular iteration no longer change. If there is no change means the data has been sorted. Called bubble sort because each key will slowly bubble to the right position
0 comments:
Post a Comment