Commit 5d507747 authored by O'Reilly Media, Inc.'s avatar O'Reilly Media, Inc.
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading

README.md

0 → 100644
+15 −0
Changes for README.md: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
## Example files for the title:  
	  
# Mastering Algorithms with C, by Kyle Loudon
	  
[![Mastering Algorithms with C, by Kyle Loudon](http://akamaicovers.oreilly.com/images/9781565924536/cat.gif)](https://www.safaribooksonline.com/library/view/title/1565924533//)
	  
The following applies to example files from material published by O’Reilly Media, Inc. Content from other publishers may include different rules of usage. Please refer to any additional usage rights explained in the actual example files or refer to the publisher’s website.
	  
O'Reilly books are here to help you get your job done. In general, you may use the code in O'Reilly books in your programs and documentation. You do not need to contact us for permission unless you're reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from our books does not require permission. Answering a question by citing our books and quoting example code does not require permission. On the other hand, selling or distributing a CD-ROM of examples from O'Reilly books does require permission. Incorporating a significant amount of example code from our books into your product's documentation does require permission.
	  
We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN.
	  
If you think your use of code examples falls outside fair use or the permission given here, feel free to contact us at <permissions@oreilly.com>.
	  
Please note that the examples are not production code and have not been carefully testing. They are provided "as-is" and come with no warranty of any kind.

examples_pc/README

0 → 100755
+68 −0
Changes for examples_pc/README: 68 added lines, 0 removed lines.
Original line number Diff line number Diff line
------------------------------------------------------------------------------
README
Mastering Algorithms with C
------------------------------------------------------------------------------

This disk contains all of the code from the book "Mastering Algorithms with C"
plus several examples illustrating how to use it.  All of the code was written
to be platform independent, with a few minor exceptions.  It has been compiled
and tested  on the platforms listed below,  but it should work  on others with
little or no modification.

   HP-UX 10.20
   SunOs 5.6 
   Linux 5.1
   DOS/Windows NT/95/98 (1, 2)

   (1) The files huffman.c and lz77.c use byte-flipping macros provided by the
       UNIX socket interface for convenience; therefore, these  files will not
       compile under Windows without similar support. The file transfer.c also
       uses two functions which are part of this interface.

   (2) The file directls.c implements a function for sorted directory listings
       in UNIX; consequently, it makes a few calls that are not typically sup-
       ported under Windows.

The source code on this disk can be freely used, adapted, and redistributed in
source or  binary form, so long as an acknowledgment appears in derived source
files. The citation should list that the code comes from the  book  "Mastering
Algorithms with C"  by Kyle Loudon,  published by O'Reilly & Associates.  This
code is under copyright and cannot be included in any other book, publication,
or  educational product  without  permission  from  O'Reilly & Associates.  No
warranty is attached; we cannot take responsibility for errors or  fitness for
use.

The disk is organized into three directories: header files, source files,  and
examples. This organization is outlined below along with a description of what
each directory contains.

   include

      This directory contains all of the header files contained and referenced
      in the book. Every file is named the same as in the book.

   source

      This directory contains all of the source files found in the book. Every
      file is named the same as in the book.

   examples

      This directory contains source code not found in the book. This code may
      be useful for experimenting with the book's code. The directory contains
      a number of subdirectories, each addressing a specific topic. Each topic
      has one or more examples (called ex-1.c, ex-2.c, etc.). Each example has
      a makefile named according to the topic addressed by the executable that
      the makefile builds. Note that small changes to a makefile may be needed
      to account for compiler differences, the make variant being applied, and
      other idiosyncracies on some systems; makefiles are provided mainly as a
      reference for which source files must be compiled and which objects must
      be linked in order to make use of certain data structures or algorithms,
      etc.

For UNIX users, it should be relatively simple to work with the makefiles that
have been distributed on this disk. Assuming the directory structure described
above, define the environment variable ALGOWC_TOPDIR  to the path at which the
directory structure begins. It may also be necessary to change the name of the
compiler or linker each makefile calls, or in a few isolated cases, adjust the
list of libraries linked with certain executables.

examples_pc/contents

0 → 100755
+93 −0
Changes for examples_pc/contents: 93 added lines, 0 removed lines.
Original line number Diff line number Diff line
source:
arclen.c     bfs.c        bisearch.c   bistree.c    bit.c       bitree.c
cbc.c        chtbl.c      clist.c      cover.c      ctsort.c    cvxhull.c
des.c        dfs.c        directls.c   dlist.c      events.c    fact.c
factor.c     facttail.c   frames.c     geodist.c    graph.c     hashpjw.c
heap.c       huffman.c    interpol.c   issort.c     lex.c       lint.c
list.c       lsqe.c       lz77.c       mgsort.c     mst.c       ohtbl.c
page.c       parcels.c    qksort.c     queue.c      root.c      route.c
rsa.c        rxsort.c     set.c        shortest.c   spell.c     stack.c
transfer.c   traverse.c   tsp.c

include:
bfs.h        bistree.h    bit.h        bitree.h     cbc.h        chtbl.h
clist.h      compress.h   cover.h      dfs.h        directls.h   dlist.h
encrypt.h    event.h      events.h     fact.h       factor.h     facttail.h
frames.h     geodist.h    geometry.h   graph.h      graphalg.h   hashpjw.h
heap.h       lex.h        list.h       nummeths.h   ohtbl.h      page.h
parcel.h     parcels.h    pqueue.h     queue.h      route.h      search.h
set.h        sort.h       spell.h      stack.h      symbol.h     transfer.h
traverse.h

examples:
bistree      bit          bitree       chtbl        clist        compress
dlist        encrypt      geometry     graph        graphalg     heap
list         nummeths     ohtbl        pqueue       queue        recurse
search       set          sort         stack

examples/bistree:
bistree.mak  ex-1.c

examples/bit:
bit.mak      ex-1.c

examples/bitree:
bitree.mak   ex-1.c

examples/chtbl:
chtbl.mak    ex-1.c

examples/clist:
clist.mak    page.mak     ex-1.c       ex-2.c

examples/compress:
compress.mak ex-1.c       sample.txt

examples/dlist:
dlist.mak    ex-1.c

examples/encrypt:
encrypt.mak  cbc.mak      ex-1.c       ex-2.c

examples/geometry:
geometry.mak geodist.mak  ex-1.c       ex-2.c

examples/graph:
graph.mak    bfs.mak      dfs.mak      ex-1.c       ex-2.c       ex-3.c

examples/graphalg:
graphalg.mak route.mak    ex-1.c       ex-2.c

examples/heap:
heap.mak     ex-1.c

examples/list:
list.mak     ex-1.c

examples/nummeths:
nummeths.mak ex-1.c

examples/ohtbl:
ohtbl.mak    ex-1.c

examples/pqueue:
pqueue.mak   ex-1.c

examples/queue:
ex-1.c
queue.mak

examples/recurse:
fact.mak     factor.mak   ex-1.c       ex-2.c

examples/search:
search.mak   spell.mak    ex-1.c       ex-2.c

examples/set:
set.mak      cover.mak    ex-1.c       ex-2.c

examples/sort:
directls.mak sort.mak     ex-1.c       ex-2.c

examples/stack:
stack.mak    ex-1.c
+103 −0
Changes for examples_pc/examples/bistree/bistree.mak: 103 added lines, 0 removed lines.
Original line number Diff line number Diff line
# ****************************************************************************
# *                                                                          *
# *  bistree.mak                                                             *
# *  ===========                                                             * 
# *                                                                          *
# ****************************************************************************

# ****************************************************************************
# *                                                                          *
# *  Define the name of the makefile.                                        *
# *                                                                          *
# ****************************************************************************

MAKNAM = bistree.mak

# ****************************************************************************
# *                                                                          *
# *  Define the directories in which to search for library files.            *
# *                                                                          *
# ****************************************************************************

LIBDRS =

# ****************************************************************************
# *                                                                          *
# *  Define the directories in which to search for include files.            *
# *                                                                          *
# ****************************************************************************

INCDRS = -I$(ALGOWC_TOPDIR)/include

# ****************************************************************************
# *                                                                          *
# *  Define the library files.                                               *
# *                                                                          *
# ****************************************************************************

LIBFLS =

# ****************************************************************************
# *                                                                          *
# *  Define the source files.                                                *
# *                                                                          *
# ****************************************************************************

SRCFLS = ex-1.c\
         $(ALGOWC_TOPDIR)/source/bistree.c\
         $(ALGOWC_TOPDIR)/source/bitree.c
         
# ****************************************************************************
# *                                                                          *
# *  Define the object files.                                                *
# *                                                                          *
# ****************************************************************************

OBJFLS = ex-1.o\
         $(ALGOWC_TOPDIR)/source/bistree.o\
         $(ALGOWC_TOPDIR)/source/bitree.o

# ****************************************************************************
# *                                                                          *
# *  Define the executable.                                                  *
# *                                                                          *
# ****************************************************************************

EXE    = ex-1.exe

# ****************************************************************************
# *                                                                          *
# *  Define the compile and link options.                                    *
# *                                                                          *
# ****************************************************************************

CC     = c89
LL     = c89
CFLAGS =
LFLAGS =

# ****************************************************************************
# *                                                                          *
# *  Define the rules.                                                       *
# *                                                                          *
# ****************************************************************************

$(EXE): $(OBJFLS)
	$(LL) $(LFLAGS) -o $@ $(OBJFLS) $(LIBDRS) $(LIBFLS)

.c.o:
	$(CC) $(CFLAGS) -o $@ -c $(INCDRS) $<

all:
	make -f $(MAKNAM) clean
	make -f $(MAKNAM) depend

depend:
	makedepend $(INCDRS) -f $(MAKNAM) $(SRCFLS)
	make -f $(MAKNAM) $(EXE)

clean:
	-rm $(EXE)
	-rm $(OBJFLS)

# DO NOT DELETE THIS LINE -- make depend depends on it.
+407 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading