SELAMAT BERKUNJUNG KE BLOG JHONY

Search

Ujian Pratikum Struktur Data



package uassd;

import java.util.Arrays;

public class sortiengint {
   
   
public static void main(String[] args) {
    int [] angka = {5,7, 1, 4, 0};
    Arrays.sort(angka);
    int index=0;
         for (index=0 ; index<angka.length ; index++)
             System.out.println(angka[index]+"");
}
}

Nama : Manuel Junisabel  Pinto
Nim : 04108011
ujian pratikum struktur Data



//package uassd;
import java.util.Arrays;/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


/**
 *
 * @author JHOVANI
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Integer[] No  = {5, 7, 1,4,0};
        Arrays.sort (No);
        int index=0;
         for (index=0 ; index<No.length ; index++)
             System.out.println(No[index]+"");
    }

}

Nama : Manuel Junisabel  Pinto
Nim : 04108011
ujian pratikum struktur Data




import java.util.LinkedList;
import java.util.Queue;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author JHOVANI
 */
public class simplequeue {

    /**
     * @param args the command line arguments
     */
    public static void main(Integer[] args) {
        // TODO code application logic here
        Queue<Integer> queue = new LinkedList<Integer>();

queue.add(5);
queue.add(7);
queue.add(1);
queue.add(4);
queue.add(0);
System.out.println("Peek = " + queue.peek());
System.out.println("Ukuran queue = " + queue.size());
queue.remove();
queue.remove();
queue.remove();
int jumlah = queue.poll()+ queue.poll();
System.out.println("Pool = " + queue.poll());
System.out.println("Ukuran queue = " + queue.size());

}
}


   
Nama : Manuel Junisabel  Pinto
Nim : 04108011
ujian pratikum struktur Data




TGS UTS


Nana                : Manuel Junisabel Pinto
Nim                 : 04108011
Prody              : Sistem Komputer
1.     Konversikan Bilangan tersebut !
(a)        (190)10  =  (10111110)2 = (276)= (BE)16
(b)       (25,234)10 = (110001010010010)2 =  (61222)8 = (6292)16
(c)        (-20)10 = (1011)2 = (13)8 = (B)16  dengan one’s complement
(d)        (-20)10 = (1100)2 = (14)8 = (C)16 dengan two’s complement

3. CONVERT AS INDICATED
a)     (1375)8 = (1011111101)2 = (2FD)16
b)    (A1EF)16 = (1010000111101111)2 = (A1EF)16
c)     (11101)2 = (35)8 = (1D)16
d)    (237.55)8 = (11101101. 101101)2 = (ED. 2D)16
e)     (10111.1011)2 = (27.13)8 = (17.B)16
f)      (CE13.A2)16 = (1100111000010011. 10100010)2 = (147023. 242)8

4. Perform the arithemetic indicated, maintaining your answer in sign-magnitude form. Check your result by converting each problem to decimal and repeating the computation.
a)     (1231)4 + (1103)4 = (3000)4
b)    (135C)16  + (1103)16 = (245F)16
c)     (110101)2 – (1011)2 = (101010)2
d)    (23)4 X (31)4 = (10033)4
e)     (1766)8 – (23)8 = (1743)8
f)      (11101101)2 / (11101)2 = (1000)2