• Tidak ada hasil yang ditemukan

Perbandingan Kompleksitas Waktu Teoretis dan Real Time Algoritma Strand Sort, Sieve Sort, Gnome Sort

N/A
N/A
Protected

Academic year: 2017

Membagikan "Perbandingan Kompleksitas Waktu Teoretis dan Real Time Algoritma Strand Sort, Sieve Sort, Gnome Sort"

Copied!
13
0
0

Teks penuh

(1)
(2)
(3)
(4)
(5)

sw.BaseStream.Seek(0, sk);

for (int i = 0; i < data2.Count; i++) {

sw.WriteLine(data2[i] + "\n"); }

sw.Flush(); sw.Close();

nama = save.FileName.Substring(0, save.FileName.Length - 4) + "_gnome.txt";

fs = new FileStream(nama, FileMode.OpenOrCreate);

sw = new StreamWriter(fs); sk = new SeekOrigin(); sw.BaseStream.Seek(0, sk);

for (int i = 0; i < data3.Count; i++) {

sw.WriteLine(data3[i] + "\n"); }

sw.Flush(); sw.Close(); }

}

private void buttonBack_Click(object sender, EventArgs e)

{

FormHome home = new FormHome(); home.Show();

this.Hide(); }

} }

(6)

//Algoritma Strand Sort using System;

using System.Collections.Generic; using System.Linq;

using System.Text;

namespace Sorting_data {

public class strandSorting {

Byte[] asciiTemp1, asciiTemp2;

List<String> words = new List<String>(); String stringTemp;

int maxChar;

public strandSorting(List<String> _words) { words = _words;

}

public List<String> prosesSort() {

if (words.Count <= 1) return words;

for (int i = 1; i < words.Count; i++) {

int j = i - 1; int index = -1;

List<string> s = new List<string>(); s.Add(words[i]);

s.Add(words[j]);

gnomeSort gnom = new gnomeSort(s); gnom.prosesSort();

while (words[i] != s[1]) {

index = j; j--;

if (j < 0) break; s.Clear();

s.Add(words[i]); s.Add(words[j]); gnom.prosesSort(); }

if (index == -1) continue;

string temp = words[i];

(7)

{

words[k] = words[k - 1]; }

words[index] = temp; }

return words;

(8)

//Algoritma Sieve Sort using System;

using System.Collections.Generic; using System.Linq;

using System.Text;

namespace Sorting_data {

public class Sievesort {

List<String> words = new List<String>(); gnomeSort gnome;

List<String> non_asc;

List<List<String>> asc = new List<List<String>>();

public Sievesort(List<String> _words) {

words = _words; }

public List<String> prosesSort(){ List<String> tempListAsc = new List<String>();

List<String> tempListNonAsc = new List<String>();

List<String> tempListMax = new List<String>();

non_asc = words;

int t = 0; int s = 1;

do {

tempListAsc.Add(non_asc[t]);

for (int i = 1; i < non_asc.Count; i++) {

tempListMax.Add(non_asc[t]); tempListMax.Add(non_asc[s]);

gnome = new gnomeSort(tempListMax); if

(gnome.prosesSort()[1].Equals(non_asc[s])) {

tempListAsc.Add(non_asc[s]); t = s;

(9)

else {

tempListNonAsc.Add(non_asc[s]); s++;

}

tempListMax = new List<string>(); }

asc.Add(tempListAsc); non_asc = tempListNonAsc;

tempListAsc = new List<string>(); tempListNonAsc = new List<string>(); t = 0;

s = 1;

} while (non_asc.Count != 0);

words = asc[0];

for(int i = 0; i < asc.Count - 1; i++) {

for(int j = 0; j < asc[i + 1].Count; j++) {

for (int k = 0; k < words.Count; k++) {

tempListMax = new List<string>();

tempListMax.Add(words[k]); tempListMax.Add(asc[i+1][j]); gnome = new

gnomeSort(tempListMax);

if

(gnome.prosesSort()[1].Equals(words[k])) {

words.Insert(k, asc[i + 1][j]);

break; }

} } }

return words; }

(10)

//Algoritma Gnome Sort using System;

using System.Collections.Generic; using System.Linq;

using System.Text;

namespace Sorting_data {

public class gnomeSort {

Byte[] asciiTemp1, asciiTemp2;

List<String> words = new List<String>(); String stringTemp;

int maxChar;

public gnomeSort(List<String> _words) { words = _words;

}

public List<String> prosesSort(){

for (int i = 1; i < words.Count; ) {

asciiTemp1 =

Encoding.ASCII.GetBytes(words[i - 1].ToCharArray()); asciiTemp2 =

Encoding.ASCII.GetBytes(words[i].ToCharArray());

maxChar = asciiTemp1.Length; if (asciiTemp1.Length >

asciiTemp2.Length) {

maxChar = asciiTemp2.Length; }

for (int j = 0; j < maxChar; j++) {

if (asciiTemp1[j] < asciiTemp2[j]) {

i++; break; }

else if (asciiTemp1[j] > asciiTemp2[j])

{

(11)

break; }

if (j == maxChar - 1) {

if (maxChar == asciiTemp1.Length) {

i++; }

else if(maxChar == asciiTemp2.Length)

{

stringTemp = words[i - 1]; words[i - 1] = words[i]; words[i] = stringTemp; i = 1;

break; }

} }

}

return words; }

(12)

DAFTAR RIWAYAT HIDUP

PERSONAL DATA

Full Name : Ruth Stephany Marsaulina Siahaan Nick Name : Fanny

Place/ Date of Birth : Medan / 01 September 1992

Sex : Wanita

Religion : Kristen Protestan Nationality : Indonesia

Address : Jl. M. Yakub no.56 Kota Medan.

Provinsi Sumatera Utara, Indonesia Mobile Phone : +62852-6110-5369

E-mail : [email protected]

EDUCATION

Bachelor of Computer Science

2014-2017 : Universitas Sumatera Utara, Medan

Diploma of Electronic Engineering

2010-2013 : Politeknik Negeri Medan

Higher Secondary Education

2007-2010 : SMA Negeri 7 Medan

Secondary Education

2004 - 2007 : SMP Budi Murni 1 Medan

Primary Education

1998 - 2004 : SD Budi Murni 7 Medan

Programming PHP, C#

Database MySQL

IDE Software

(13)

ORGANIZATIONAL EXPERIENCE

Organization Position Year

OSIS SMP Anggota 2005-2007

OSIS SMA Ketua Departemen Agama Kristen 2008-2010

PADUAN SUARA SMA Bendahara 2008-2010

PA SMA Anggota 2007-2010

KMK POLMED Anggota 2011-2012

HMPS TEKNIK ELEKTRO Ketua Sie.Humas 2011-2012

BEM POLMED Anggota 2012-2013

Referensi

Dokumen terkait

Hasil peneltian ini menunjukkan bahwa penggunaan kulit kakao dan minyak jelantah merupakan katalis dan bahan baku yang murah cocok dalam pembuatan biodiesel. Kata kunci

Suku pertama dan suku kelima suatu barisan aritmetika berturut–turut adalah 2 dan 10, jumlah dua puluh suku pertama barisan tersebut adalah ….. Diketahui

Perhatia n siswa saat mengikuti pembelajaran pada kondisi awal sebesar 55,56% dan setelah mendapat tindakan dengan penggunaan metode CTL dalam pembelajaran pada siklus I

Objek-objek tersebut dapat divisualisasikan dengan berbagai cara, pilihlah unsur- unsur rupa (garis, warna, tekstur, bidang, volume, ruang), sesuai dengan kebutuhan interes

Adapun tujuan dari penelitian ini adalah untuk mengetahui bagaimana kondisi ketersediaan pangan di Indonesia saat ini dan bagaimana pengaruh kontribusi

penelitian ini bertujuan untuk mengetahui pengaruh terapi puisi sebagai media ekspresi emosi terhadap penurunan tingkat stres pada mahasiswa baru.. Desain penelitian ini

Kompetisi yang terjadi antara surat kabar Solopos dan Joglosemar dalam hal penyajian rubrik-rubrik berita ( type of content ). Kompetisi ini mencakup besarnya

Hasil pembelajaran yang akan dicapal deng alah.. Berdasarkan pengamatan penulis dalam pelaksanaan metode pembelajaran ini, siswa lebih antusias dalam belajar. Hal