mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
C++ 算法大全
f499342869
-introduced variable 'swap' for 'outer-for-loop' of bubble sort algorithm. If it remains zero after executing inner-loop, it means array is sorted, hence it does not need to run for n^2 times. - 'for(int j=0; j<n-1-i; j++)', as after each step, one number reaches to its right position. Thus inner loop does not need to run for 'n' times in every cycle. |
||
---|---|---|
Backtracking | ||
Computer Oriented Statistical Methods | ||
Datastructures | ||
Dynamic Programming | ||
Graph | ||
Greedy Algorithms | ||
Hashing | ||
Math/Prime_Factorization | ||
Operations on Datastructures | ||
Others | ||
Range queries | ||
Search | ||
Sorting | ||
Array Left Rotation.cpp | ||
Array Right Rotation.cpp | ||
Binary Search Tree.cpp | ||
Binary Search.cpp | ||
Buzz_number.cpp | ||
circluar_Queue_using_Linked_List.cpp | ||
Circular Linked List.cpp | ||
Circular Queue Using Array.cpp | ||
combsort.cpp | ||
Decimal To Binary.cpp | ||
Decimal To Hexadecimal .cpp | ||
Decimal to Roman Numeral.cpp | ||
Doubly Linked List.cpp | ||
fibonacci.cpp | ||
GCD_of_n_numbers.cpp | ||
Happy_number.cpp | ||
Intersection_of_2_arrays.cpp | ||
Linear Search.cpp | ||
Linked List.cpp | ||
List Array.cpp | ||
NumericStringSort.cpp | ||
Paranthesis Matching.cpp | ||
Primality Test.cpp | ||
Queue Using Array.cpp | ||
Queue Using Linked List.cpp | ||
README.md | ||
Reverse a Linked List using Recusion.cpp | ||
s[i] | ||
searching.cpp | ||
sieve_of_Eratosthenes.cpp | ||
sleep sort.c | ||
smallest-circle.cpp | ||
Sparse matrix.cpp | ||
spiral_print.cpp | ||
Stack Using Array.cpp | ||
Stack Using Linked List.cpp | ||
Strassen Matrix Multiplication.cpp | ||
ternary_search.cpp | ||
Tower of Hanoi.cpp | ||
Tree.cpp | ||
Union_of_2_arrays.cpp |
C++
This repository contains some useful algorithms and data structures.
Contribute
How you can contribute? See this small guide.
- Use the directory structure of the repository.
- Please describe your pull requests.
- Don't use bits/stdc++.h because this is quite Linux specific and slow down the compiler process.
- Put in comments in your code.
- Avoid struct uses instead the class keyword.
- Add some test cases in the main-function.