Git Product home page Git Product logo

oldtexascode2's Introduction

Old Texas Code

Java Coding Samples

Various Java programs to illustrate various concepts from an old CS course at UTexas.edu. This java code is from the last century.

Fork this repo to your account, clone your repo to your machine.

Read all this code. Puzzle over what it does.

Choose one of these code samples. Add a file with your name as the filename (ex: SteveJ.md), write me a brief paragraph that describes what your chosen code sample does and how it works.

Add, commit, push and do a Pull Request.

  • A Hello World! Java program.

  • Calling Methods. A sample of how to call methods in the same class.

  • For loop. A simple example of using for loops to calculate factorial. Uses the built in int data type so only good to 13!

  • Enhanced for loop

  • Value Parameters: An example that shows the behavior of value parameters. In Java all parameters are passed by value. 

  • String Example. A few brief examples of String manipulations.

  • BinaryConverter. A program with examples of various Java syntax that converts a base 10 int to base 2 String.

  • PrimeEx A program with various approaches to determine if an int is prime or not. Used to demonstrate Java syntax. You need the Stopwatch class, a non standard Java class, as well.

  • Pointers as Value parameters

  • Array Examples

  • 2D array Example. A simplified version of filtering a picture represented by ints.

  • 2D array example. Very simple version of the Conway's Game of Life.

  • Getting input from Keyboard with Scanner class

  • Reading ints from file with Scanner class

  • Writing ints to file

  • Connecting to and reading from a web page.

  • Program to create ASCII frequency table from file and url. Demonstration of try / catch blocks. The CIA 2008 Factbook may be downloaded from Project Gutenberg.

  • IntListVer1 First version of the IntList class developed in class. Developing class to illustrate various class design and implementation issues in Java.

  • IntListTesterVer1

  • IntListVer2 Added default add method, equals method, and toString methods. Includes versions of toString using String concatenation and StringBuffer to illustarte performance differences.

  • IntListTesterVer2

  • IntListVer3. Added insert and remove methods.

  • SortedIntList. Inherits from InListVer3 to create a SortedIntList. Class is "broken" because random insertions still allowed.

  • GenericList. Altered the list to store anything, not just ints.

  • Die class. A class that models a playing die.

  • DemoClass: This illustrates some of the more confusing concepts in class syntax and mechanics such as constructors, static vs. instance methods, and method overloading. 

  • Stopwatch class. A class for measuring how long it takes for a program to run.

  • Create a Set. A method that using polymorphism to create a set from an array.

  • Recursion examples. Includes examples on finding space taken up by files in a directory including all files in all subdirectories, recursive factorial, recursive power, recursive Fibonacci numbers, and a simple knapsack problem.

  • Eight Queens example. Code to find a a solution to an N queens problem. Note the queensAreSafe method has not been completed.

  • Airlines example. Determine if airlines can be moved from airline to another based on network of airline partners. Here is a sample input file.

  • Minesweeper. Another example of recursion from the game minesweeper.

  • GenericListVersion2. Changed the GenericList class so that it implements the Iterable interface in order to demonstrate how to implement an iterator using an inner class.

  • GenericListVersion3. Changed GenericList so it is generic based on Java generics syntax instead of relying on Object.

  • ListNode. A singly linked node class used to build linked lists

  • IList. A simple list interface

  • LinkedList. Similar to the LinkedList developed in class. Does not contain all the methods you would expect of a LinkedList. Also implements the iterator remove method in O(N) time. An O(1) time remove method is possible.

  • UnsortedHashSet - An unsorted set that uses a hashtable with closed address hashing to store values. Currently only the add method is implemented.

  • UnsortedSetTest - A method to compare Java's TreeSet and HashSet to the BianrySearchTree, UnsortedSet, and UnsortedHashSet classes developed in class. Note you need a lot of other files for this to work.

  • SimpleWordCount - Program demonstrating use of a map to count the frequency of words in a file.

  • WordCount - Program  that compares counting words in files using an ArrayList and a Map.

oldtexascode2's People

Contributors

xt0fer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.