Skip to content

Commit c282100

Browse files
committed
working with build scripts
1 parent 210f4e6 commit c282100

File tree

15 files changed

+37
-25
lines changed

15 files changed

+37
-25
lines changed

Code/Chapter3/example3-3/sample.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file Memory/sample.c Program to show addresses in memory
2+
* @file sample.c Program to show addresses in memory
33
* @brief
44
* Small program to show internal memory addresses.
55
*

Code/Clock/tableA-6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file Clock/sample.c Show timing example in both milliseconds and nanonseconds.
2+
* @file Clock/tableA-6.c Show timing example in both milliseconds and nanonseconds.
33
* @brief
44
* Show the ability on Unix systems to time both using milliseconds and
55
* nanosecond timers.

Code/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PROJECT_NAME = Algorithms_in_a_Nutshell
3131
# This could be handy for archiving the generated documentation or
3232
# if some version control system is used.
3333

34-
PROJECT_NUMBER = 1.0
34+
PROJECT_NUMBER = 2.0
3535

3636
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
3737
# base path where the generated documentation will be put.

Code/Graph/MinimumSpanningTree/mst_slow.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file mst.cxx Prim's Algorithm for Minimum Spanning Tree problem
2+
* @file mst_slow.cxx Prim's Algorithm for Minimum Spanning Tree problem
33
* @brief
44
*
55
* Defines the implementation using Prim's Algorithm to minimum spanning

Code/Graph/MinimumSpanningTree/msttsp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file tsplib.c Test driver code that understands TSP data formatn
2+
* @file msttsp.c Test driver code that understands TSP data formatn
33
* @brief
44
* Driver that can load up dense graphs whose input is stored using
55
* the TSP format as recognized by the community.

Code/README

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
This directory contains the C and C++ code solutions as coded in the
2-
O'Reilly book "Algorithm in a Nutshell" by George Heineman, Gary Pollice,
3-
and Stanley Selkow, (C) 2008.
2+
O'Reilly book "Algorithm in a Nutshell", Second Edition, by George
3+
Heineman, Gary Pollice, and Stanley Selkow, (C) 2016.
44

55
INSTALLATION
66

@@ -16,6 +16,10 @@ BUILD
1616

1717
To build, type 'make' in this top-level directory.
1818

19+
DOCUMENTATION
20+
21+
To build the Doxygen documentation, type 'make doxygen'
22+
1923
TEST
2024

2125
To test all available test cases, type 'make test' in this top-level

Code/Sorting/Ints/modifiedQsort.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file modifiedQsort.c
2+
* @file Ints/modifiedQsort.c
33
* @brief
44
*
55
* Find crossover where InsertionSort is slower than FullQsort using

Code/Sorting/Ints/testSmallArrays.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ void insertion (int *ar, int low, int high) {
8888
* Inline code using macro to set value
8989
*
9090
* \param vals the array of elements.
91-
* \param left the left end of the subarray range
92-
* \param right the right end of the subarray range
91+
* \param left the left end of the subarray range.
92+
* \param right the right end of the subarray range.
93+
* \param pivot variable for pivot.
9394
* \return int in the range [left, right] to use in partition.
9495
*/
9596
#define selectPivotIndex(vals,left,right,pivot)\

Code/Sorting/Ints/timeSmallArrays.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ void insertion (int *ar, int low, int high) {
104104
* Inline code using macro to set value
105105
*
106106
* \param vals the array of elements.
107-
* \param left the left end of the subarray range
108-
* \param right the right end of the subarray range
107+
* \param left the left end of the subarray range.
108+
* \param right the right end of the subarray range.
109+
* \param pivot variable to use for pivot.
109110
* \return int in the range [left, right] to use in partition.
110111
*/
111112
#define selectPivotIndex(vals,left,right,pivot)\

Code/Sorting/PointerBased/merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file merge.c Merge Sort implementation
2+
* @file PointerBased/merge.c Merge Sort implementation
33
* @brief
44
* Contains Merge Sort implementation.
55
*

Code/Sorting/PointerBased/parallelQsort.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file baseQsort.c Multithread Quicksort implementation
2+
* @file parallelQsort.c Multithread Quicksort implementation
33
* @brief
44
*
55
* Complete Multithread Quicksort implementation using PThreads implementation.

Code/Sorting/PointerBased/stripped_baseQsort.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file baseQsort.c Quicksort implementation
2+
* @file stripped_baseQsort.c Quicksort implementation
33
* @brief
44
* Complete Quicksort implementation optimized to switch to Insertion
55
* Sort when problem sizes are less than or equal to minSize in length.

Code/Sorting/ValueBased/modifiedQsort.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file modifiedQsort.c
2+
* @file ValueBased/modifiedQsort.c
33
* @brief
44
*
55
* See how well optimized Qsort compares with qsort() unix library
@@ -61,9 +61,10 @@ while (ct > sizeof (int)) { \
6161
* ASSUMES THAT pivot value is already placed in ar[right] and that
6262
* ar[left] <= ar[mid] <= ar[right].
6363
*
64-
* @param ar array of elements to be sorted.
65-
* @param left lower bound index position (inclusive)
66-
* @param right upper bound index position (exclusive)
64+
* @param pbase pointer to base of array of elements to be sorted.
65+
* @param n number of elements in the array.
66+
* @param s fixed size of each element.
67+
* @param cmp comparator function.
6768
* @return location of the pivot index properly positioned.
6869
*/
6970
void *partition (void *const pbase, size_t n, size_t s,
@@ -128,14 +129,15 @@ void insertion (void *base, int n, int s,
128129

129130
/**
130131
* Select pivot index to use in partition based on median of three.
131-
* Places smallest value in vals[left] and the mdeian value in vals[right].
132+
* Places smallest value in vals[left] and the median value in vals[right].
132133
* The largest of the three is actually placed in vals[mid]
133134
*
134135
* Inline code using macro to set value
135136
*
136137
* \param vals the array of elements.
137-
* \param left the left end of the subarray range
138-
* \param right the right end of the subarray range
138+
* \param n the number of elements in the array.
139+
* \param s the size in bytes of each value.
140+
* \param cmp the comparator function.
139141
* \return int in the range [left, right] to use in partition.
140142
*/
141143
#define selectPivotIndex(vals,n,s,cmp) \

README.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,14 @@ Primary Task
115115

116116
Apparently, ant 1.7 does not have this second CLASSPATH requirement.
117117

118-
5. cd into 'Tasks' and type 'ant' to build special ant task
118+
5. cd into 'Task' and type 'ant' to build special ant task
119119

120120
go back to main directory (cd ..) and continue. At this point you
121121
may have to ensure that the ant libraries ${ant.home}/lib/ant.jar
122122
are in your CLASSPATH.
123123

124-
6. Type 'ant' to compile all Java code (in JavaCode directory).
124+
6. Type 'ant' to compile all Java code (in JavaCode, Examples, Figures,
125+
and PerformanceTests).
125126

126127
This will compile all sources and execute the JUnit test cases
127128

@@ -177,7 +178,7 @@ Optional Tasks
177178
progress. Only works if you have valid JAVA_HOME set to locate
178179
tools.jar. Find the compiled JUnit report in:
179180

180-
./Tests/bin/report/
181+
./Tests/report/
181182

182183
This option is likely only available for ant 1.7 (and higher).
183184

Task/build.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
<target name="all"
5050
description="Build runall task">
5151

52+
<!-- Make sure bin directory exists -->
53+
<mkdir dir="Task/bin"/>
54+
5255
<javac srcdir="Task/src"
5356
destdir="Task/bin"
5457
debug="${compile.debug}"

0 commit comments

Comments
 (0)