/* Stack_adt.c -- stack model implementation file */ # include # include # include "stack_adt.h" /* local function declaration */ static stack_node * make_node (const name * const panme ); /* interface function definition */ int
/* Hash. C -- hash table implementation file */ # include # include # include "hash. H " /* local function declaration */ static int get_a_prime (const int number ); static int is_a_prime (const int number); static int square (const int I );
Red/black tree, I remember I found this thing when I first bought the book. I thought it was mysterious and finally got in touch with it. I have already written it. I'm very happy.
The inserted routine is included in the book.CodeImplemented. I am
Determine the maximum flow of a tree, that is, the sum of the maximum flow of leaves, that is, the flow of the whole tree.
The outbound traffic of each non-leaf node in the tree = min (inbound traffic, path capacity ).
Knowing this, we can solve
This mainly reflects thoughts. the problem was first defined on a known exercise, so there was no universality. in implementation, if the name is stored in the stack and the index is stored at the same time, many function calls will be skipped. in
/* Adjacenty_list.c -- Name of the adjacent table */ # include # include # include "adjacenty_list.h" /* local function declaration */ vertex * make_vertex (const name vertex); /* interface function definition */ int createadjacent_list
For half a day, I wrote a D-heap implementation. It's not bad. I 've deepened my understanding of the priority queue and pasted the code.
/* D-heap.h -- d-heap file */ # define mindata-32678 /* data type definition */ typedef int item; typedef
2-D tree, written yesterday. I wanted to have a good time playing the ball today. I don't want to play for a short time, so I came to the Internet.
This feature supports two-dimensional range search and is very useful. I do not acknowledge the
The shortest path algorithm for a single source node in a directed acyclic graph uses Topology Sorting, which is a good idea.
Provided the functions used and posted them.
//DAGShortestPathCalculate.cpp -- 2011-09-05-18.35//private methods
Maximum stream algorithm. the algorithm running on the directed graph. before introducing algorithms, we provide various concepts. residual network, augmented path, cut. the implementation is intuitive, and the breadth-first search is used. O (VE)
A previous thinking question, which was implemented yesterday, used a priority queue. I implemented a queue through the linked list. I am used to this.
This header file defines the data types and macros of two data structures. This is the first
Let's look at the code. It is also implemented yesterday.
/* 2011-04-12-18.00.c -- Explore the Union *//* suppose current machine works as little endian. */ # include Union U { char array [4]; int value; }; /* int main (void); int main
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service