Kamis, 25 April 2019

DSA ( Data Struktur dan Algoritma )

 Pengertian Algoritma

Algoritma adalah urutan langkah untuk menyelesaikan masalah secara sistematis dan logis. Algoritma menawarkan suatu metode dalam menyelesaikan sebuah permasalahan. Algoritma diartikan sebagai urutan langkah dalam menyelesaikan masalah secara sistematis dan logis. Pendekatan secara sistematis dan logis tersebut, menjadikan proses penyelesaian masalah terjaga kebenarannya karena algoritma hendaklah benar agar dapat menghasilkan keluaran/solusi yang benar pula. Penyelesaian masalah(problem solving) adalah kegiatan utama yang dilakukan dalam menyelesaiakan sesuatu. Adapun langkah-langkah Problem Solving adalah sebagai berikut :
  1. Mengidentifikasi masalah
  2. Desain
  3. Algoritma
  4. Pembuatan program
  5. Pengujian
  6. Pemeliharaan
Algoritma biasa ditulis dalam bentuk pseudo code. Perhatikan contoh berikut ini:
Carilah luas persegi panjang jika diketahui x sebagai nilai panjang dan y sebagai nilai lebar.
  1. panjang ← masukkan x sebagai nilai panjang
  2. lebar ← masukkan y sebagai nilai lebar
  3. luas ← panjang * lebar
  4. Tulis luas
Tentukan bilangan masukan berikut sebagai bilangan postif, negatif atau nol.
  1. Bilangan ← bilangan yang akan diuji
  2. If bilangan > 0 then tulis “Bilangan Positif”
  3. If bilangan < 0 then tulis “ Bilangan Negatif”
  4. Tulis “Nol”
Tampilkan tulisan “Selamat Belajar” sebanyak 10 kali
  1. x ← masukkan nilai perulangan
  2. i ← 1
  3. Jika i <= x, tulis “Selamat Belajar”

     

     

    Ciri Algoritma :
  4. Algoritma harus berhenti setelah mengerjakan sejumlah langkah terbatas.
  5. Setiap langkah harus didefinisikan dengan tepat dan tidak berarti-dua (Ambiguitas).
  6. Algoritma memiliki nol atau lebih masukkan.
  7. Algoritma memiliki nol atau lebih keluaran.
  8. Algoritma harus efektif (setiap langkah harus sederhana sehingga dapat dikerjakan dalam waktu yang masuk akal)
Contoh :
Algoritma untuk melakukan sesuatu dalam kehidupan sehari-hari, misalnya jika kita ingin menulis surat, maka anda perlu melakukan beberapa langkah-langkah berikut:
  1. Mempersiapkan kertas dan amplop
  2. Mempersiapkan alat tulis, seperti pena atau pensil.
  3. Mulai menulis
  4. Memasukkan kertas ke dalam amplop
  5. Pergi ke kantor pos untuk mengeposkan surat tersebut
Struktur Data
Struktur data adalah suatu pengelolaan data sehingga data dapat dipergunakan secara lebih efisien dan efektif. Dalam bahasa pemrograman, struktur data seringkali ditampakkan secaa fisik dalam bentuk tabel (biasanya pada bahasa pemrograman/pengelolaan database berbasis visual), namun pada beberapa bahasa pemrograman yang tidak berbasis visual, strutkur data lebih berupa pengelolaan data dengan aturan-aturan tertentu. Beberapa konsep pengelolaan data sederhana adalah sebagai berikut :
1. Array
Array adalah kumpulan data bertipe sama dan menggunakan nama yang sama pula. Antara satu variabel dengan variabel lain di dalam array dibedakan berdasarkan “subscript”. Subscript berupa bilangan di dalam kurung siku [...]. Melalui subscript inilah masing-masing elemen dapat diakses.
2. Array Berdimensi Satu 
Array berdimensi satu adalah sekumpulan data/elemen yang disimpan secara berurutan dalam suatu tempat/subscript yang terdiri atas 1 (satu) unsur. Sejumlah data suhu disimpan dalam nama suhu terdiri dari Suhu 1 = 25°, Suhu 2 = 23,5°, Suhu 3 = 21°, Suhu 4 = 26° dan Suhu 5 = 35° Pendefinisian array meliputi nama array, tipe elemen array dan jumlah elemen array.
Contoh : 
Float nilai_mhs [12]; 
Keterangan :
1. tipe array : float (bilangan pecah)
2. nama array : nilai_mhs
3. jumlah elemen array : 12 data, yaitu nilai_mhs[1], nilai_mhs[2],…., nilai_mhs[12].

Nilai elemen array dapat dimasukkan melalui keyboard atau dimasukkan saat didefinisikan pada program. 
3. Array Berdimensi Dua
Array berdimensi satu adalah sekumpulan data/elemen yang disimpan secara berurutan dalam suatu tempat/subscript yang terdiri atas 2 (dua) unsur, yaitu baris dan kolom. Array berdimensi dua berarti meiliki dua dimensi data.
4. Array Sebagai Argumen Fungsi 
Array juga dapat berkedudukan sebagi parameter di dalam fungsi. 
Contoh pendefinisian :

const int MAKS = 5
Int data[MAKS]; 

5. Fungsi 
Fungsi adalah bagian program yang berisi sejumlah pernyataan tertentu yang dapat dipanggil berulang kali. Tujuan pembuatan fungsi adalah :
1. Memudahkan dalam mengembangkan program
2. Menghemat ukuran program
Beberapa hal yang harus diperhatikan dalam pembuatan fungsi adalah :

1. Fungsi menerima masukan yang disebut argumen atau parameter.
2. Masukan diproses oleh fungsi dan memberikan hasil akhir yang disebut nilai balik (return value).
3. Agar fungsi dapat dipanggil, fungsi harus dideklarasikan. 
6. Prototipe 

Deklarasi fungsi disebut prototype fungsi yang berupa :
1. nama fungsi
2. tipe nilai balik fungsi
3. jumlah dan tipe argument
4. serta diakhiri dengan titik koma (;).

Contoh : 

long kuadrat(long l) 
dimana menyatakan kuadrat() adalah nama fungsi, long adalah tipe argument, long (kedua) menunjukkan nilai balik yang bertipe long 
void garis() 
menyatakan fungsi tanpa nilai balik

Pernyataan return digunakan untuk memberikan nilai balik fungsi. Dalam fungsi diatas berarti nilai kuadrat dari argument. Fungsi dengan pernyataan void tidak memberikan nilai balik. Biasanya tidak diakhiri pernyataan return. Jenis variabel dalam kaitannya dengan lingkup fungsi terdapat tiga macam yaitu : variabel otomatis, variabel eksternal dan variabel statis.
·         Variabel Lokal (otomatis) : Variabel yang didefinisikan di dalam fungsi disebut variabel local. Variabel ini hanya dikenal dalam fungsi tersebut.
·         Variabel Global (Eksternal) : Variabel yang didefinisikan di bagian luar manapun dari fungsi dan dikenal oleh semua fungsi. Disebut juga variabel global, karena dikenal de semua fungsi.
·         Variabel Statis : Baik variabel local maupun global dapat berfungsi sebagai variabel statis dengan cara menambahkan pada kedua variabel tersebtu pernyatan static. Kemudian pada kedua variabel tersebtu berlaku hal sebagai berikut :
1.      Jika variabel local berdiri sebagai variabel statis maka variabel tetap hanya dapat diakses pada fungsi yang mendefinisikannya, variabel tidak hilang saat eksekusi fungsi berakhir. Nilainya akan tetap dipertahankan, sehingga akan dikenali pada pemanggilan fungsi untuk tahap berikutnya.
2.      Inisialisasi oleh pemrogram akan dilakukan sekali saja selama program dijalankan. Jika tidak ada inisialisasi secara eksplisit, variabel diisi dengan nol.
3.      Jika variabel eksternal dijadikan sebagai variabel statis, variabel ini dapat diakses oleh semua file yang didefinisikan pada file yang sama dengan variabel eksternal tersebut . 

Sumber :
http://indra-cwogat.blogspot.com/2013/12/pengertian-algoritma-dan-struktur-data.html 
http://herny.staff.unisbank.ac.id/2011/10/29/pengertian-algoritma-struktur-data-dan-pemrograman/


     

Kamis, 11 April 2019

The fourth industrial revolution


The Fourth Industrial Revolution (4IR) is the fourth major industrial era since the initial Industrial Revolution of the 18th century. It is characterized by a fusion of technologies that is blurring the lines between the physical, digital and biological spheres, collectively referred to as cyber-physical systems. It is marked by emerging technology breakthroughs in a number of fields, including robotics, artificial intelligence, nanotechnology, quantum computing, biotechnology, the Internet of Things, the Industrial Internet of Things (IIoT), decentralized consensus, fifth-generation wireless technologies (5G), additive manufacturing/3D printing and fully autonomous vehicles.


The impact on business

An underlying theme in my conversations with global CEOs and senior business executives is that the acceleration of innovation and the velocity of disruption are hard to comprehend or anticipate and that these drivers constitute a source of constant surprise, even for the best connected and most well informed. Indeed, across all industries, there is clear evidence that the technologies that underpin the Fourth Industrial Revolution are having a major impact on businesses.
On the supply side, many industries are seeing the introduction of new technologies that create entirely new ways of serving existing needs and significantly disrupt existing industry value chains. Disruption is also flowing from agile, innovative competitors who, thanks to access to global digital platforms for research, development, marketing, sales, and distribution, can oust well-established incumbents faster than ever by improving the quality, speed, or price at which value is delivered.
Major shifts on the demand side are also occurring, as growing transparency, consumer engagement, and new patterns of consumer behavior (increasingly built upon access to mobile networks and data) force companies to adapt the way they design, market, and deliver products and services.
A key trend is the development of technology-enabled platforms that combine both demand and supply to disrupt existing industry structures, such as those we see within the “sharing” or “on demand” economy. These technology platforms, rendered easy to use by the smartphone, convene people, assets, and data—thus creating entirely new ways of consuming goods and services in the process. In addition, they lower the barriers for businesses and individuals to create wealth, altering the personal and professional environments of workers. These new platform businesses are rapidly multiplying into many new services, ranging from laundry to shopping, from chores to parking, from massages to travel.
On the whole, there are four main effects that the Fourth Industrial Revolution has on business—on customer expectations, on product enhancement, on collaborative innovation, and on organizational forms. Whether consumers or businesses, customers are increasingly at the epicenter of the economy, which is all about improving how customers are served. Physical products and services, moreover, can now be enhanced with digital capabilities that increase their value. New technologies make assets more durable and resilient, while data and analytics are transforming how they are maintained. A world of customer experiences, data-based services, and asset performance through analytics, meanwhile, requires new forms of collaboration, particularly given the speed at which innovation and disruption are taking place. And the emergence of global platforms and other new business models, finally, means that talent, culture, and organizational forms will have to be rethought.
Overall, the inexorable shift from simple digitization (the Third Industrial Revolution) to innovation based on combinations of technologies (the Fourth Industrial Revolution) is forcing companies to reexamine the way they do business. The bottom line, however, is the same: business leaders and senior executives need to understand their changing environment, challenge the assumptions of their operating teams, and relentlessly and continuously innovate.

The impact on government

As the physical, digital, and biological worlds continue to converge, new technologies and platforms will increasingly enable citizens to engage with governments, voice their opinions, coordinate their efforts, and even circumvent the supervision of public authorities. Simultaneously, governments will gain new technological powers to increase their control over populations, based on pervasive surveillance systems and the ability to control digital infrastructure. On the whole, however, governments will increasingly face pressure to change their current approach to public engagement and policymaking, as their central role of conducting policy diminishes owing to new sources of competition and the redistribution and decentralization of power that new technologies make possible.
Ultimately, the ability of government systems and public authorities to adapt will determine their survival. If they prove capable of embracing a world of disruptive change, subjecting their structures to the levels of transparency and efficiency that will enable them to maintain their competitive edge, they will endure. If they cannot evolve, they will face increasing trouble.
This will be particularly true in the realm of regulation. Current systems of public policy and decision-making evolved alongside the Second Industrial Revolution, when decision-makers had time to study a specific issue and develop the necessary response or appropriate regulatory framework. The whole process was designed to be linear and mechanistic, following a strict “top down” approach.
But such an approach is no longer feasible. Given the Fourth Industrial Revolution’s rapid pace of change and broad impacts, legislators and regulators are being challenged to an unprecedented degree and for the most part are proving unable to cope.
How, then, can they preserve the interest of the consumers and the public at large while continuing to support innovation and technological development? By embracing “agile” governance, just as the private sector has increasingly adopted agile responses to software development and business operations more generally. This means regulators must continuously adapt to a new, fast-changing environment, reinventing themselves so they can truly understand what it is they are regulating. To do so, governments and regulatory agencies will need to collaborate closely with business and civil society.
The Fourth Industrial Revolution will also profoundly impact the nature of national and international security, affecting both the probability and the nature of conflict. The history of warfare and international security is the history of technological innovation, and today is no exception. Modern conflicts involving states are increasingly “hybrid” in nature, combining traditional battlefield techniques with elements previously associated with nonstate actors. The distinction between war and peace, combatant and noncombatant, and even violence and nonviolence (think cyberwarfare) is becoming uncomfortably blurry.
As this process takes place and new technologies such as autonomous or biological weapons become easier to use, individuals and small groups will increasingly join states in being capable of causing mass harm. This new vulnerability will lead to new fears. But at the same time, advances in technology will create the potential to reduce the scale or impact of violence, through the development of new modes of protection, for example, or greater precision in targeting.

The impact on people

The Fourth Industrial Revolution, finally, will change not only what we do but also who we are. It will affect our identity and all the issues associated with it: our sense of privacy, our notions of ownership, our consumption patterns, the time we devote to work and leisure, and how we develop our careers, cultivate our skills, meet people, and nurture relationships. It is already changing our health and leading to a “quantified” self, and sooner than we think it may lead to human augmentation. The list is endless because it is bound only by our imagination.
I am a great enthusiast and early adopter of technology, but sometimes I wonder whether the inexorable integration of technology in our lives could diminish some of our quintessential human capacities, such as compassion and cooperation. Our relationship with our smartphones is a case in point. Constant connection may deprive us of one of life’s most important assets: the time to pause, reflect, and engage in meaningful conversation.
One of the greatest individual challenges posed by new information technologies is privacy. We instinctively understand why it is so essential, yet the tracking and sharing of information about us is a crucial part of the new connectivity. Debates about fundamental issues such as the impact on our inner lives of the loss of control over our data will only intensify in the years ahead. Similarly, the revolutions occurring in biotechnology and AI, which are redefining what it means to be human by pushing back the current thresholds of life span, health, cognition, and capabilities, will compel us to redefine our moral and ethical boundaries.

References

https://en.m.wikipedia.org/wiki/Fourth_Industrial_Revolution
https://www.weforum.org/agenda/2016/01/the-fourth-industrial-revolution-what-it-means-and-how-to-respond/