Tuesday, 25 February 2020

Ascending Bubble Sort Example

Ascending Bubble Sort:
We can sorting data with bubble sort methods, let's do sorting data with bubble sort methods! This is example for ascending:

The data is:

Record[1][2][3][4][5][6][7][8][9][10]
Data201008010703060904050

Record[1][2][3][4][5][6][7][8][9][10]
Data201008010703060904050
Step 120100801070306090405020 and 100, No Exchange
20100801070306090405020 and 80, No Exchange
20100801070306090405020 and 10, Exchange
10100802070306090405010 and 70, No Exchange
10100802070306090405010 and 30, No Exchange
10100802070306090405010 and 60, No Exchange
10100802070306090405010 and 90, No Exchange
10100802070306090405010 and 40, No Exchange
10100802070306090405010 and 50, No Exchange
Result 1101008020703060904050
Step 2101008020703060904050100 and 80, Exchange
10801002070306090405080 and 20, Exchange
10201008070306090405020 and 70, No Exchange
10201008070306090405020 and 30, No Exchange
10201008070306090405020 and 60, No Exchange
10201008070306090405020 and 90, No Exchange
10201008070306090405020 and 40, No Exchange
10201008070306090405020 and 50, No Exchange
Result 2102010080703060904050
Step 3102010080703060904050100 and 80, Exchange
10208010070306090405080 and 70, Exchange
10207010080306090405070 and 30, Exchange
10203010080706090405030 and 60, No Exchange
10203010080706090405030 and 90, No Exchange
10203010080706090405030 and 40 , No Exchange
10203010080706090405030 and 50, No Exchange
Result 3102030100807060904050
Step 4102030100807060904050100 and 80, Exchange
10203080100706090405080 and 70, Exchange
10203070100806090405070 and 60, Exchange
10203060100807090405060 and 90, No Exchange
10203060100807090405060 and 40, Exchange
10203040100807090605040 and 50, No Exchange
Result 4102030401008070906050
Step 5102030401008070906050100 and 80, Exchange
10203040801007090605080 and 70, Exchange
10203040701008090605070 and 90, No Exchange
10203040701008090605070 and 60, Exchange
10203040601008090705060 and 50, Exchange
Result 5102030405010080907060
Step 6102030405010080907060100 and 80, Exchange
10203040508010090706080 and 90, No Exchange
10203040508010090706080 and 70, Exchange
10203040507010090806070 and 60, Exchange
Result 6102030405060100908070
Step 7102030405060100908070100 and 90, Exchange
10203040506090100807090 and 80, Exchange
10203040506080100907080 and 70, Exchange
Result 7102030405060701009080
Step 8102030405060701009080100 and 90, Exchange
10203040506070901008090 and 80, Exchange
Result 8102030405060708010090
Step 9102030405060708010090100 and 90, Exchange
Result 9102030405060708090100

Wednesday, 12 February 2020

Binary Search (2)

For Example, the data is:
The key is 2

Record[1][2][3][4][5]
Data252116

First step: the data must be sorting. This sample, we can sort the data with bubble sort methods.

Record[1][2][3][4][5]
Data252116
Step 12521162 and 5, no Exchange
2521162 and 21, no Exchange
1521262 and 1, Exchange 
Step 21521265 and 21, no Exchange
1221562 and 5, Exchange
Step 31252165 and 21, Exchange
Step 412562121 and 6, Exchange
Second step: we can search data key 2 with binary search

New data:

Record [1][2][3][4][5]
Data125621

Step [1]:
                (low+high) div 2 =  (1+5) div 2
                                            =  6 div 2
                                            =  3
                the data on the record [3] is 5, then 5>3, next step swipe left


lowmiddlehigh
Record [1][2][3][4][5]
Data125621

Step [2]:   new_high = middle-1 =3 - 1 = 2
                (low + new_high) div 2 = (1+2) div 2
                                                    = 3 div 2
                                                    = 1
                the data on the record [1] is 1, then 1<2, next step swipe right


lownew_high
Record [1][2][3][4][5]
Data125621

Step [3]:  new_low = low + 1 = 2
                (new_low + new_high) div 2 = (2+2) div 2
                                                    = 4 div 2
                                                    = 2

new_low=new_high
Record [1][2][3][4][5]
Data125621

                the data on the record [2] is 2, end.

REseArCH 1

SISTEM PERHITUNGAN LAMA PENYINARAN MATAHARI DENGAN METODE OTSU THRESHOLD (STUDI KASUS: ST. KLIMATOLOGI BARONGAN)

Asih Pujiastuti, Agus Harjoko

Abstract

Solar radiation measurements in climatology station barongan done by using campbell stokes and record card. Solar radiation is the accumulation of the whole length of the object radiation recorded on the record card. Solar radiation data reading performed by observers by estimating the long of object irradiation compared with the scale of hours listed on the record card. The difficulties encountered by observers in conducting solar radiation data readout is the shape of the object radiation recorded on the record card are not always in the form of elongated areas, some areas disjointed, even can only form small holes along the track on the card record. The purpose of this study was to design and build a system that can be used to calculate solar radiation recorded on the card record, thus increasing the accuracy of measurement data readout. Cropping process is carried out in order to obtain the right area for analysis. The approach method in object segmentation is done by implementing a solar radiation threshold otsu method. The test results showed that the determination of the radius of the opening and removing noise value appropriately irradiation can obtain the number of objects on test images with RMSEof1.4429 compared with the amount of exposure o f the image of the original object. Results of calculation solar radiation by the system showed system RMSE o f 0,51 to observer calculation.

http://ejournals.stta.ac.id/index.php/compiler/article/view/166