/CppHelper

Containg useful things.

Primary LanguageC++MIT LicenseMIT

CppHelper

Containg useful things.

With those shortcuts, you can be faster in writing the code and the code is more readable. Besides those shortcuts, you will get different functions written in MACRO.

WARNING If you want to use those macros, you must not use this style for parameter names outside of macros:

_xxx_

For examples see Examples.cpp.

List of functionality:

Math:

  • FACTORIAL (Math) as macro
  • FIBONACCI (return array of all steps) as macro
  • FIBONACCI Nth (return only the last step) as macro
  • FIBONACCIClosedForm as macro
  • PRIME FACTORS as macro
  • HARDYRAMANUJAN MACRO as macro
  • PRIMALITY TEST as macro
  • EUCLIDEAN ALGORITHM ITERATIVE as macro
  • LEAST COMMON MULTIPLE as macro
  • SIEVE OF ERATOSTHENES as macro
  • IS POWER OF TWO BITWISE as macro
  • IS POWER OF TWO as macro
  • PASCAL TRIANGLE as macro
  • DEGREE_TO_RADIAN as macro
  • RADIAN_TO_DEGREE as macro
  • FAST_POWERING as macro
  • HORNER_METHOD as macro
  • CLASSIC_POLYNOME as macro
  • COMPLEX NUMBER as macro
  • BIT MANIPULATION written in macro

Shortcuts:

  • shortcuts for std::cout, cin, cerr, clog, endl, string
  • shortcut for writing new line --> std::cout << std::endl
  • shortcuts for defining different vectors std::vector<int, double, ...
  • shortcut for defining 2D int vector
  • shortcuts for enable/disable boolalpha

Data Structures

  • LINKED LIST written in macro and additional class functions:
  • DOUBLY LINKED LIST written in macro and class functions:
  • HEAP (NOT FINISHED)
  • QUEUE written in macro and class functions
  • STACK written in macro and class functions
  • HASH TABLE written in macro and class functions

Searches:

  • LINEAR SEARCH as macro

Sets:

  • COMBINATIONS (with and without repetitions) as recursion
  • fisherYates macro and function
  • Power set macro and function
  • OFFSET_3D_ARRAY_ONE_POINTER (calculate offset of 3D array used as only one pointer)
  • cartesian product
  • longest_common_subsequence
  • knap sack
  • longest increasing subsequence

Sorting:

  • merge sort