C language for quick sorting and tail recursion

See A question. tail recursion, loop for recursion. The idea is good, and it is very useful. There is no gorgeous performance improvement, but it just shows the idea of tail recursion. Indeed, I haven't understood the fast sorting yet. Let's

C language of the binary heap file combined with the Kruskal Algorithm

/* Binary_heap_for_kruskal.h -- binary heap file */ # include "new_adjacenty_list.h" /* data type definition */ typedef struct edge { int v_hash_value; int w_hash_value; int weight; } edge; typedef struct binary_heap { edge * heap; int

Partial path compression. Partial path compression C Language

Unlike path compression, partial path compression makes the nodes on the access path move up. /* 8-14-12-03-00.30.c -- Chapter 8, question 1 */ settype find (disjiontset gather, const item ); settype find (disjiontset gather, const item) {

Non-intersection ADT implementation file C Language

At first, we chose to use the ADT operation to allocate storage space. later I found that. in this way, there are so many problems that no analysis results will be produced after the analysis. simply go straight to the problem. My thoughts are good,

Stack implementation file C Language

/* 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

Use the hash table of Dijkstra algorithm to implement the C language of the file

/* 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 );

Binary heap implementation file C language with the Kruskal Algorithm

/* Binary_heap_for_kruskal.c -- binary heap implementation file */ # include # include # include "binary_heap_for_kruskal.h" /* local function declaration */ static int percolate_up (const binary_heap * const PBH, const int index); static int

C language for generating model header files in the adjacent table

/* New_adjacenty_list.h -- adjacent header file */ # include # include "hash. H " # define infinity (~ (1 # define negativeinfinity (-Infinity-1) /* data type definition */ typedef struct adjoin_to_vertex { int hash_value; int cvw; struct

The model generated by the adjacent table is implemented in C language.

/* New_adjacenty_list.c -- Name of the adjacent table */ # include # include # include "new_adjacenty_list.h" /* local function declaration */ static adjoin_to_vertex * make_adjoin_to_vertex (const hash_table * const PHT, const name, const int

The lowest access cost of the Binary Search Tree. C Language

Dynamic Planning Algorithm. Calculate the minimum access cost after the current Binary Search Tree is constructed into the optimal binary search tree. although I have not written a routine to generate the optimal binary search tree, I am very happy.

Minimum Spanning Tree prim algorithm C Language

I was writing the Kruskal algorithm and thought that I should not be too overdrawn. After all, the young capital would easily be squandered. Yesterday I did not take off my clothes and slept all night. It will take up to 5.30 days, and it will be a

C language for Toll Road Reconstruction

Back-to-algorithm. This is also written after various hardships. After writing it, I don't want to say anything more. /* 10-40-11-02-16-06.10.c -- Chapter 10, question 1 *//* 02-18-40th. it took about 13 hours. */ # include # include # define

C language for Stack header files

/* Stack_adt.h -- stack model header file */ /* data type definition */ typedef char name; typedef struct stack_node { name; struct stack_node * Next; } stack_node; typedef stack_node * stack; /* interface function declaration */ /* operation:

Graph cutting point search C Language

This is used to find all cut points in an undirected graph. The implementation method is simplified and the routine is correct. This algorithm does not work for Directed Graphs. This function is implemented by performing a deep-first search to

Read the graph into the adjacent header file. C Language

/* Adjacenty_list.h -- adjacent header file */ # include /* data type definition */ typedef char name; typedef struct vertex { name; struct vertex * Next; } vertex; typedef struct adjacency_list { vertex * List; int * indegree; int capacity;

Invert an adjacent Table C Language

Invert an adjacent table without considering the weight. It is a function serving another routine. paste it. Int reverse_a (adjacenty_list * const padj, const hash_table * const Pht) { name; adjoin_to_vertex * scan, * new_vertex, * temp_1, ** temp_

C language for topological sorting

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

C language for top-down tree header files

After several days, the Code finally appeared today. It is much easier to stretch the tree from top to bottom than the one written last year. I understand what people have summarized. It is very difficult for me to write it myself. Some tips for

Search for Strongly Connected Branch C Language

This task has been written for 8 hours. It is relatively slow. Implementation is completed step by step. The method is as follows: 1. Perform a depth-first search on the source image, and sort the vertex labels in the subsequent order. 2. Reverse

Minimum path for single-node authorization C Language

In other words, I wrote this thing for more than four days. I wrote it for 10 hours today and finally finished it. I feel a lot of feelings .! The new data structure needs to be used in combination with the previous data structure. I designed it

Total Pages: 5902 1 .... 5245 5246 5247 5248 5249 .... 5902 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.