dsalglib  1.0.0
dsalglib is a ready to use data structures and algorithms library written in C++ . Object Oriented Template implementations are written.
alginc.h
Go to the documentation of this file.
1 //
2 // Created by moghya_s on 10/1/2016.
3 //
4 
5 #ifndef DSALGLIB_ALGINC_H
6 #define DSALGLIB_ALGINC_H
7 
8 /*
9  * contains fundamental functions required
10  */
11 
12 namespace dsa
13 {
14 
15 
16  template<typename T>
17  inline void swapit(T &x, T &y)
18  {
19  T t = x;
20  x = y;
21  y = t;
22  }
23 
24  template<typename T>
25  inline T maxof(T x, T y)
26  {
27  T max;
28  max = (x > y) ? x : y;
29  return max;
30  }
31 
32  template<typename T>
33  inline T minof(T x, T y)
34  {
35  T min;
36  min = (x < y) ? x : y;
37  return min;
38  }
39 
40 }
41 #endif //DSALGLIB_ALGINC_H
void swapit(T &x, T &y)
Definition: alginc.h:17
Definition: alginc.h:12
T minof(T x, T y)
Definition: alginc.h:33
T maxof(T x, T y)
Definition: alginc.h:25