Posts

Showing posts from June, 2014

CS 4150 Midterm

LEARN FROM MY MISTAKES Dalibor Labudovic CS 4150 Midterm All answers to discussion questions need to be in complete sentences and grammatically correct! 80/100 Compare static type binding and dynamic type binding. Be sure to use the four criteria (readability, writability, reliability, and cost). Comparing static type binding and dynamic type binding is determining whether a type binding has the ability to be changed. Static type binding obviously cannot be changed, under the four criteria’s: readability is low, writability is high ( variables have to utilized in another way to extend size ) , reliability is high (because following as the type is being used in one way and then in a different when the size has to altered) and cost is high. My thoughts on cost being high are the limitation a static type binding would pose on scalability. Dynamic type binding can be changed and under the four criteria’s: readability is high (a v

Double Transposition in Java

/* Dalibor Labudovic*/ /* not stable */ package doubletransporition; import java.io.*; import java.util.*; class NewDoubleTransposition {     public static void main(String args[])     {         NewEncryptAndDecrypt ned=new NewEncryptAndDecrypt();         ned.input();     } } class NewEncryptAndDecrypt {     Scanner sc=new Scanner(System.in);     void input()     {         int ch;         do         {             System.out.println("\n\t\t*****ENTER*****");             System.out.println("\t1.Encrypt");             System.out.println("\t2.Decrypt");             System.out.println("\t0.Exit");             ch=sc.nextInt();             switch(ch)                {                 case 1:                 {                     encrypt();                     break;                 }                 case 2:                 {                     decrypt();                     break;                 }             }         }while(ch!=0);     }     void

Vigenere Cipher in Java

/* Dalibor Labudovic */ /* Not 100% stable but work ok*/ package cs3550; import java.util.Scanner; public class vigenerecipher {     public static void main(String[] args) {         @SuppressWarnings("resource")         Scanner input = new Scanner(System.in);                         System.out.println("Encyption...");         System.out.println("Enter Pass Phrase: ");         String phrase = input.nextLine();         System.out.println("Enter plain Text: ");         String plain = input.nextLine();         System.out.print("Here is the encryption: ");         String enc = encrypt(plain, phrase);         System.out.println(enc);                 System.out.println("Decrpytion...");         System.out.println("Decoding " + enc);         System.out.println("Enter pass phrase: ");         String dePhrase = input.nextLine();         System.out.println("Decryption : " + decrypt(enc, dePhrase));     }

CS3401 Quiz 3

Image
        Linear  time is the class of all complexity functions that are which of the following: O(log  n ) O( n  log  n ) O( n ) O(1) Question 2 5 / 5 points If an algorithm with an input size of  n  has two separate, unnested loops, the performance of the algorithm will be which of the following: O(2) O( n ) O( n 2 ) O(2 n ) Question 3 0 / 5 points Suppose you have a list named  numbers  whose type is  ArrayList <Integer> . Then which of the following for-each loop will print out all of its elements on separate lines: for ( int x : numbers)     System.out.println (x)