Month: June 2013

  • Sample multi-threaded program using join, synchronized, wait and notify

    Thread Illustration package; import java.util.LinkedList; import java.util.Queue; public class ThreadIllustration { private static Queue<Integer> jobQueue = new LinkedList<Integer>(); /** * @param args */ public static void main(String[] args) { ThreadIllustration monitor = new ThreadIllustration(); Thread controller = new Thread(new Controller(monitor)); controller.start(); } private static class Controller implements Runnable { private Object monitor; public Controller(Object […]

  • Data Structures Visualization

    Requirements List all the data structures ex: Queue, Stack, Tree Support tagging at each data structure instance. ex: LinkedList may be tagged as list, queue. Represent the hierarchy of data structures visually using the above tags. e.g. abstract data types —> concrete data types —> to use-case specific/application data types. Concrete example¬†Tree —> Binary Tree […]