Package edu.princeton.cs.algs4
-
Interface Summary Interface Description DrawListener -
Class Summary Class Description Accumulator TheAccumulatorclass is a data type for computing the running mean, sample standard deviation, and sample variance of a stream of real numbers.AcyclicLP TheAcyclicLPclass represents a data type for solving the single-source longest paths problem in edge-weighted directed acyclic graphs (DAGs).AcyclicSP TheAcyclicSPclass represents a data type for solving the single-source shortest paths problem in edge-weighted directed acyclic graphs (DAGs).AdjMatrixEdgeWeightedDigraph TheAdjMatrixEdgeWeightedDigraphclass represents a edge-weighted digraph of vertices named 0 through V - 1, where each directed edge is of typeDirectedEdgeand has a real-valued weight.Alphabet AmericanFlag TheAmericanFlagclass provides static methods for sorting an array of extended ASCII strings or integers in-place using American flag sort.AmericanFlagX TheAmericanFlagXclass provides static methods for sorting an array of extended ASCII strings or integers in-place using American Flag sort.Arbitrage TheArbitrageclass provides a client that finds an arbitrage opportunity in a currency exchange table by constructing a complete-digraph representation of the exchange table and then finding a negative cycle in the digraph.AssignmentProblem TheAssignmentProblemclass represents a data type for computing an optimal solution to an n-by-n assignment problem.Average TheAverageclass provides a client for reading in a sequence of real numbers and printing out their average.AVLTreeST<Key extends java.lang.Comparable<Key>,Value> TheAVLTreeSTclass represents an ordered symbol table of generic key-value pairs.Bag<Item> TheBagclass represents a bag (or multiset) of generic items.BellmanFordSP TheBellmanFordSPclass represents a data type for solving the single-source shortest paths problem in edge-weighted digraphs with no negative cycles.BinaryDump TheBinaryDumpclass provides a client for displaying the contents of a binary file in binary.BinaryIn Binary input.BinaryInsertion TheBinaryInsertionclass provides a static method for sorting an array using an optimized binary insertion sort with half exchanges.BinaryOut Binary output.BinarySearch TheBinarySearchclass provides a static method for binary searching for an integer in a sorted array of integers.BinarySearchST<Key extends java.lang.Comparable<Key>,Value> TheBSTclass represents an ordered symbol table of generic key-value pairs.BinaryStdIn Binary standard input.BinaryStdOut Binary standard output.BinomialMinPQ<Key> The BinomialMinPQ class represents a priority queue of generic keys.Bipartite TheBipartiteclass represents a data type for determining whether an undirected graph is bipartite or whether it has an odd-length cycle.BipartiteMatching TheBipartiteMatchingclass represents a data type for computing a maximum (cardinality) matching and a minimum (cardinality) vertex cover in a bipartite graph.BipartiteX TheBipartiteXclass represents a data type for determining whether an undirected graph is bipartite or whether it has an odd-length cycle.BlackFilter TheBlackFilterclass provides a client for reading in a blacklist of words from a file; then, reading in a sequence of words from standard input, printing out each word that does not appear in the file.BoruvkaMST TheBoruvkaMSTclass represents a data type for computing a minimum spanning tree in an edge-weighted graph.BoyerMoore TheBoyerMooreclass finds the first occurrence of a pattern string in a text string.BreadthFirstDirectedPaths TheBreadthDirectedFirstPathsclass represents a data type for finding shortest paths (number of edges) from a source vertex s (or set of source vertices) to every other vertex in the digraph.BreadthFirstPaths TheBreadthFirstPathsclass represents a data type for finding shortest paths (number of edges) from a source vertex s (or a set of source vertices) to every other vertex in an undirected graph.BST<Key extends java.lang.Comparable<Key>,Value> TheBSTclass represents an ordered symbol table of generic key-value pairs.BTree<Key extends java.lang.Comparable<Key>,Value> TheBTreeclass represents an ordered symbol table of generic key-value pairs.Cat TheCatclass provides a client for concatenating the results of several text files.CC TheCCclass represents a data type for determining the connected components in an undirected graph.ClosestPair TheClosestPairdata type computes a closest pair of points in a set of n points in the plane and provides accessor methods for getting the closest pair of points and the distance between them.CollisionSystem TheCollisionSystemclass represents a collection of particles moving in the unit box, according to the laws of elastic collision.Complex TheComplexclass represents a complex number.Count TheCountclass provides anAlphabetclient for reading in a piece of text and computing the frequency of occurrence of each character over a given alphabet.Counter TheCounterclass is a mutable data type to encapsulate a counter.CPM TheCPMclass provides a client that solves the parallel precedence-constrained job scheduling problem via the critical path method.Cycle TheCycleclass represents a data type for determining whether an undirected graph has a simple cycle.Date TheDateclass is an immutable data type to encapsulate a date (day, month, and year).DeDup TheDeDupclass provides a client for reading in a sequence of words from standard input and printing each word, removing any duplicates.DegreesOfSeparation TheDegreesOfSeparationclass provides a client for finding the degree of separation between one distinguished individual and every other individual in a social network.DepthFirstDirectedPaths TheDepthFirstDirectedPathsclass represents a data type for finding directed paths from a source vertex s to every other vertex in the digraph.DepthFirstOrder TheDepthFirstOrderclass represents a data type for determining depth-first search ordering of the vertices in a digraph or edge-weighted digraph, including preorder, postorder, and reverse postorder.DepthFirstPaths TheDepthFirstPathsclass represents a data type for finding paths from a source vertex s to every other vertex in an undirected graph.DepthFirstSearch TheDepthFirstSearchclass represents a data type for determining the vertices connected to a given source vertex s in an undirected graph.Digraph TheDigraphclass represents a directed graph of vertices named 0 through V - 1.DigraphGenerator TheDigraphGeneratorclass provides static methods for creating various digraphs, including Erdos-Renyi random digraphs, random DAGs, random rooted trees, random rooted DAGs, random tournaments, path digraphs, cycle digraphs, and the complete digraph.DijkstraAllPairsSP TheDijkstraAllPairsSPclass represents a data type for solving the all-pairs shortest paths problem in edge-weighted digraphs where the edge weights are nonnegative.DijkstraSP TheDijkstraSPclass represents a data type for solving the single-source shortest paths problem in edge-weighted digraphs where the edge weights are nonnegative.DijkstraUndirectedSP TheDijkstraUndirectedSPclass represents a data type for solving the single-source shortest paths problem in edge-weighted graphs where the edge weights are nonnegative.DirectedCycle TheDirectedCycleclass represents a data type for determining whether a digraph has a directed cycle.DirectedCycleX TheDirectedCycleXclass represents a data type for determining whether a digraph has a directed cycle.DirectedDFS TheDirectedDFSclass represents a data type for determining the vertices reachable from a given source vertex s (or set of source vertices) in a digraph.DirectedEdge TheDirectedEdgeclass represents a weighted edge in anEdgeWeightedDigraph.DirectedEulerianCycle TheDirectedEulerianCycleclass represents a data type for finding an Eulerian cycle or path in a digraph.DirectedEulerianPath TheDirectedEulerianPathclass represents a data type for finding an Eulerian path in a digraph.DoublingRatio TheDoublingRatioclass provides a client for measuring the running time of a method using a doubling ratio test.DoublingTest TheDoublingTestclass provides a client for measuring the running time of a method using a doubling test.Draw Draw.Edge TheEdgeclass represents a weighted edge in anEdgeWeightedGraph.EdgeWeightedDigraph TheEdgeWeightedDigraphclass represents a edge-weighted digraph of vertices named 0 through V - 1, where each directed edge is of typeDirectedEdgeand has a real-valued weight.EdgeWeightedDirectedCycle TheEdgeWeightedDirectedCycleclass represents a data type for determining whether an edge-weighted digraph has a directed cycle.EdgeWeightedGraph TheEdgeWeightedGraphclass represents an edge-weighted graph of vertices named 0 through V – 1, where each undirected edge is of typeEdgeand has a real-valued weight.EulerianCycle TheEulerianCycleclass represents a data type for finding an Eulerian cycle or path in a graph.EulerianPath TheEulerianPathclass represents a data type for finding an Eulerian path in a graph.FarthestPair TheFarthestPairdata type computes the farthest pair of points in a set of n points in the plane and provides accessor methods for getting the farthest pair of points and the distance between them.FenwickTree Created by ricardodpsx@gmail.com on 4/01/15.FFT TheFFTclass provides methods for computing the FFT (Fast-Fourier Transform), inverse FFT, linear convolution, and circular convolution of a complex array.FibonacciMinPQ<Key> FileIndex TheFileIndexclass provides a client for indexing a set of files, specified as command-line arguments.FlowEdge TheFlowEdgeclass represents a capacitated edge with a flow in aFlowNetwork.FlowNetwork TheFlowNetworkclass represents a capacitated network with vertices named 0 through V - 1, where each directed edge is of typeFlowEdgeand has a real-valued capacity and flow.FloydWarshall TheFloydWarshallclass represents a data type for solving the all-pairs shortest paths problem in edge-weighted digraphs with no negative cycles.FordFulkerson TheFordFulkersonclass represents a data type for computing a maximum st-flow and minimum st-cut in a flow network.FrequencyCounter TheFrequencyCounterclass provides a client for reading in a sequence of words and printing a word (exceeding a given length) that occurs most frequently.GabowSCC TheGabowSCCclass represents a data type for determining the strong components in a digraph.GaussianElimination TheGaussianEliminationdata type provides methods to solve a linear system of equations Ax = b, where A is an m-by-n matrix and b is a length n vector.GaussJordanElimination TheGaussJordanEliminationdata type provides methods to solve a linear system of equations Ax = b, where A is an n-by-n matrix and b is a length n vector.Genome TheGenomeclass provides static methods for compressing and expanding a genomic sequence using a 2-bit code.GlobalMincut TheGlobalMincutclass represents a data type for computing a global minimum cut in an edge-weighted graph where the edge weights are nonnegative.GrahamScan TheGrahamScandata type provides methods for computing the convex hull of a set of n points in the plane.Graph TheGraphclass represents an undirected graph of vertices named 0 through V – 1.GraphGenerator TheGraphGeneratorclass provides static methods for creating various graphs, including Erdos-Renyi random graphs, random bipartite graphs, random k-regular graphs, and random rooted trees.GrayscalePicture This class provides methods for manipulating individual pixels of a grayscale image.GREP TheGREPclass provides a client for reading in a sequence of lines from standard input and printing to standard output those lines that contain a substring matching a specified regular expression.Heap TheHeapclass provides a static methods for heapsorting an array.HexDump TheHexDumpclass provides a client for displaying the contents of a binary file in hexadecimal.HopcroftKarp TheHopcroftKarpclass represents a data type for computing a maximum (cardinality) matching and a minimum (cardinality) vertex cover in a bipartite graph.Huffman TheHuffmanclass provides static methods for compressing and expanding a binary input using Huffman codes over the 8-bit extended ASCII alphabet.In Input.IndexBinomialMinPQ<Key> The IndexBinomialMinPQ class represents an indexed priority queue of generic keys.IndexFibonacciMinPQ<Key> IndexMaxPQ<Key extends java.lang.Comparable<Key>> TheIndexMaxPQclass represents an indexed priority queue of generic keys.IndexMinPQ<Key extends java.lang.Comparable<Key>> TheIndexMinPQclass represents an indexed priority queue of generic keys.IndexMultiwayMinPQ<Key> The IndexMultiwayMinPQ class represents an indexed priority queue of generic keys.InplaceMSD TheInplaceMSDclass provides static methods for sorting an array of extended ASCII strings using in-place MSD radix sort.Insertion TheInsertionclass provides static methods for sorting an array using insertion sort.InsertionX TheInsertionXclass provides static methods for sorting an array using an optimized version of insertion sort (with half exchanges and a sentinel).Interval1D TheInterval1Dclass represents a one-dimensional interval.Interval2D TheInterval2Dclass represents a closed two-dimensional interval, which represents all points (x, y) with bothxmin <= x <= xmaxandymin <= y <= ymax.Inversions TheInversionsclass provides static methods to count the number of inversions in either an array of integers or comparables.KMP TheKMPclass finds the first occurrence of a pattern string in a text string.Knuth TheKnuthclass provides a client for reading in a sequence of strings and shuffling them using the Knuth (or Fisher-Yates) shuffling algorithm.KosarajuSharirSCC TheKosarajuSharirSCCclass represents a data type for determining the strong components in a digraph.KruskalMST TheKruskalMSTclass represents a data type for computing a minimum spanning tree in an edge-weighted graph.KWIK TheKWIKclass provides aSuffixArrayclient for computing all occurrences of a keyword in a given string, with surrounding context.LazyPrimMST TheLazyPrimMSTclass represents a data type for computing a minimum spanning tree in an edge-weighted graph.LinearProbingHashST<Key,Value> TheLinearProbingHashSTclass represents a symbol table of generic key-value pairs.LinearProgramming TheLinearProgrammingclass represents a data type for solving a linear program of the form { max cx : Ax ≤ b, x ≥ 0 }, where A is a m-by-n matrix, b is an m-length vector, and c is an n-length vector.LinearRegression TheLinearRegressionclass performs a simple linear regression on an set of n data points (yi, xi).LinkedBag<Item> TheLinkedBagclass represents a bag (or multiset) of generic items.LinkedQueue<Item> TheLinkedQueueclass represents a first-in-first-out (FIFO) queue of generic items.LinkedStack<Item> TheLinkedStackclass represents a last-in-first-out (LIFO) stack of generic items.LongestCommonSubstring TheLongestCommonSubstringclass provides aSuffixArrayclient for computing the longest common substring that appears in two given strings.LongestRepeatedSubstring TheLongestRepeatedSubstringclass provides aSuffixArrayclient for computing the longest repeated substring of a string that appears at least twice.LookupCSV TheLookupCSVclass provides a data-driven client for reading in a key-value pairs from a file; then, printing the values corresponding to the keys found on standard input.LookupIndex TheLookupIndexclass provides a data-driven client for reading in a key-value pairs from a file; then, printing the values corresponding to the keys found on standard input.LSD TheLSDclass provides static methods for sorting an array of w-character strings or 32-bit integers using LSD radix sort.LZW TheLZWclass provides static methods for compressing and expanding a binary input using LZW compression over the 8-bit extended ASCII alphabet with 12-bit codewords.MaxPQ<Key> TheMaxPQclass represents a priority queue of generic keys.Merge TheMergeclass provides static methods for sorting an array using mergesort.MergeBU TheMergeBUclass provides static methods for sorting an array using bottom-up mergesort.MergeX TheMergeXclass provides static methods for sorting an array using an optimized version of mergesort.MinPQ<Key> TheMinPQclass represents a priority queue of generic keys.MSD TheMSDclass provides static methods for sorting an array of extended ASCII strings or integers using MSD radix sort.Multiway TheMultiwayclass provides a client for reading in several sorted text files and merging them together into a single sorted text stream.MultiwayMinPQ<Key> The MultiwayMinPQ class represents a priority queue of generic keys.NFA TheNFAclass provides a data type for creating a nondeterministic finite state automaton (NFA) from a regular expression and testing whether a given string is matched by that regular expression.NonrecursiveDFS TheNonrecursiveDFSclass represents a data type for finding the vertices connected to a source vertex s in the undirected graph.NonrecursiveDirectedDFS TheNonrecursiveDirectedDFSclass represents a data type for finding the vertices reachable from a source vertex s in the digraph.Out This class provides methods for writing strings and numbers to various output streams, including standard output, file, and sockets.Particle TheParticleclass represents a particle moving in the unit box, with a given position, velocity, radius, and mass.PatriciaSET ThePatriciaSETclass provides an implementation of an unordered set, with the restriction that the items (keys) are of classString.PatriciaST<Value> ThePatriciaSTclass provides an implementation of an unordered symbol table of key-value pairs, with the restriction that the key is of classString.Picture This class provides methods for manipulating individual pixels of an image using the RGB color format.PictureDump ThePictureDumpclass provides a client for displaying the contents of a binary file as a black-and-white picture.Point2D ThePointclass is an immutable data type to encapsulate a two-dimensional point with real-value coordinates.Polynomial ThePolynomialclass represents a polynomial with integer coefficients.PrimMST ThePrimMSTclass represents a data type for computing a minimum spanning tree in an edge-weighted graph.Queue<Item> TheQueueclass represents a first-in-first-out (FIFO) queue of generic items.Quick TheQuickclass provides static methods for sorting an array and selecting the ith smallest element in an array using quicksort.Quick3string TheQuick3stringclass provides static methods for sorting an array of strings using 3-way radix quicksort.Quick3way TheQuick3wayclass provides static methods for sorting an array using quicksort with 3-way partitioning.QuickBentleyMcIlroy TheQuickBentleyMcIlroyclass provides static methods for sorting an array using an optimized version of quicksort (using Bentley-McIlroy 3-way partitioning, Tukey's ninther, and cutoff to insertion sort).QuickFindUF TheQuickFindUFclass represents a union–find data type (also known as the disjoint-sets data type).QuickUnionUF TheQuickUnionUFclass represents a union–find data type (also known as the disjoint-sets data type).QuickX TheQuickXclass provides static methods for sorting an array using an optimized version of quicksort (using Hoare's 2-way partitioning algorithm, median-of-3 to choose the partitioning element, and cutoff to insertion sort).RabinKarp TheRabinKarpclass finds the first occurrence of a pattern string in a text string.RandomSeq TheRandomSeqclass is a client that prints out a pseudorandom sequence of real numbers in a given range.RectHV TheRectHVclass is an immutable data type to encapsulate a two-dimensional axis-aligned rectagle with real-value coordinates.RedBlackBST<Key extends java.lang.Comparable<Key>,Value> TheBSTclass represents an ordered symbol table of generic key-value pairs.ResizingArrayBag<Item> TheResizingArrayBagclass represents a bag (or multiset) of generic items.ResizingArrayQueue<Item> TheResizingArrayQueueclass represents a first-in-first-out (FIFO) queue of generic items.ResizingArrayStack<Item> TheResizingArrayStackclass represents a last-in-first-out (LIFO) stack of generic items.RunLength TheRunLengthclass provides static methods for compressing and expanding a binary input using run-length coding with 8-bit run lengths.SegmentTree TheSegmentTreeclass is an structure for efficient search of cummulative data.Selection TheSelectionclass provides static methods for sorting an array using selection sort.SeparateChainingHashST<Key,Value> TheSeparateChainingHashSTclass represents a symbol table of generic key-value pairs.SequentialSearchST<Key,Value> TheSequentialSearchSTclass represents an (unordered) symbol table of generic key-value pairs.SET<Key extends java.lang.Comparable<Key>> TheSETclass represents an ordered set of comparable keys.Shell TheShellclass provides static methods for sorting an array using Shellsort with Knuth's increment sequence (1, 4, 13, 40, ...).SparseVector TheSparseVectorclass represents a d-dimensional mathematical vector.ST<Key extends java.lang.Comparable<Key>,Value> TheSTclass represents an ordered symbol table of generic key-value pairs.Stack<Item> TheStackclass represents a last-in-first-out (LIFO) stack of generic items.StaticSETofInts TheStaticSETofIntsclass represents a set of integers.StdArrayIO Standard array IO.StdAudio Standard audio.StdDraw TheStdDrawclass provides a basic capability for creating drawings with your programs.StdIn TheStdInclass provides static methods for reading strings and numbers from standard input.StdOut This class provides methods for printing strings and numbers to standard output.StdRandom TheStdRandomclass provides static methods for generating random number from various discrete and continuous distributions, including uniform, Bernoulli, geometric, Gaussian, exponential, Pareto, Poisson, and Cauchy.StdStats TheStdStatsclass provides static methods for computing statistics such as min, max, mean, sample standard deviation, and sample variance.Stopwatch TheStopwatchdata type is for measuring the time that elapses between the start and end of a programming task (wall-clock time).StopwatchCPU TheStopwatchCPUdata type is for measuring the CPU time used during a programming task.SuffixArray TheSuffixArrayclass represents a suffix array of a string of length n.SuffixArrayX TheSuffixArrayXclass represents a suffix array of a string of length n.SymbolDigraph TheSymbolDigraphclass represents a digraph, where the vertex names are arbitrary strings.SymbolGraph TheSymbolGraphclass represents an undirected graph, where the vertex names are arbitrary strings.TarjanSCC TheTarjanSCCclass represents a data type for determining the strong components in a digraph.ThreeSum TheThreeSumclass provides static methods for counting and printing the number of triples in an array of integers that sum to 0 (ignoring integer overflow).ThreeSumFast TheThreeSumFastclass provides static methods for counting and printing the number of triples in an array of distinct integers that sum to 0 (ignoring integer overflow).TopM TheTopMclass provides a client that reads a sequence of transactions from standard input and prints the m largest ones to standard output.Topological TheTopologicalclass represents a data type for determining a topological order of a directed acyclic graph (DAG).TopologicalX TheTopologicalXclass represents a data type for determining a topological order of a directed acyclic graph (DAG).Transaction TheTransactionclass is an immutable data type to encapsulate a commercial transaction with a customer name, date, and amount.Transaction.HowMuchOrder Compares two transactions by amount.Transaction.WhenOrder Compares two transactions by date.Transaction.WhoOrder Compares two transactions by customer name.TransitiveClosure TheTransitiveClosureclass represents a data type for computing the transitive closure of a digraph.TrieSET TheTrieSETclass represents an ordered set of strings over the extended ASCII alphabet.TrieST<Value> TheTrieSTclass represents an symbol table of key-value pairs, with string keys and generic values.TST<Value> TheTSTclass represents an symbol table of key-value pairs, with string keys and generic values.TwoPersonZeroSumGame TheTwoPersonZeroSumGameclass represents a data type for computing optimal row and column strategies to two-person zero-sum games.UF TheUFclass represents a union–find data type (also known as the disjoint-sets data type).Vector TheVectorclass represents a d-dimensional Euclidean vector.WeightedQuickUnionUF TheWeightedQuickUnionUFclass represents a union–find data type (also known as the disjoint-sets data type).WhiteFilter TheWhiteFilterclass provides a client for reading in a whitelist of words from a file; then, reading in a sequence of words from standard input, printing out each word that appears in the file.Whitelist TheWhitelistclass provides a client for reading in a set of integers from a file; reading in a sequence of integers from standard input; and printing to standard output those integers not in the whitelist.
DataMelt 3.0 © DataMelt by jWork.ORG