Java Reference
In-Depth Information
figure 5.16
Return a string
containing lots of x's.
public static String makeLongString1( int N )
{
String result = "";
for( int i = 0; i < N; i++ )
result += "x";
return result;
}
public static String makeLongString2( int N )
{
StringBuilder result = new StringBuilder( "" );
for( int i = 0; i < N; i++ )
result.append( "x" );
return new String( result );
}
references
The maximum contiguous subsequence sum problem is from [5]. References
[4], [5], and [6] show how to optimize programs for speed. Interpolation
search was first suggested in [14] and was analyzed in [13]. References [1],
[8], and [17] provide a more rigorous treatment of algorithm analysis. The
three-part series [10], [11], and [12], newly updated, remains the foremost ref-
erence work on the topic. The mathematical background required for more
advanced algorithm analysis is provided by [2], [3], [7], [15], and [16]. An
especially good book for advanced analysis is [9].
A. V. Aho, J. E. Hopcroft, and J. D. Ullman, The Design and Analysis of
Computer Algorithms , Addison-Wesley, Reading, MA, 1974.
1.
M. O. Albertson and J. P. Hutchinson, Discrete Mathematics with Algo-
rithms , John Wiley & Sons, New York, 1988.
2.
Z. Bavel, Math Companion for Computer Science , Reston Publishing
Company, Reston, VA, 1982.
3.
J. L. Bentley, Writing Efficient Programs , Prentice-Hall, Englewood
Cliffs, NJ, 1982.
4.
J. L. Bentley, Programming Pearls , Addison-Wesley, Reading, MA,
1986.
5.
 
Search WWH ::




Custom Search