
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

400 Views
In C or C++, there are four different datatypes, that are used for integer type data. These four datatypes are short, int, long and long long. Each of these datatypes takes different memory spaces. The size varies in different architecture and different operating systems. Sometimes int takes 4-bytes or sometimes it takes 2-bytes. This also happen for the compilers. So we can use cross compilers.The cross compilers are basically a compiler, which is capable of compiling for a platform other than current platform.So if we want to compile the following code in 32bit system, and 64-bit system, it will generate ... Read More

2K+ Views
The C programming language was developed by Dennis Ritchie during early 1970. It was developed to redesign UNIX operating system.Earlier the B language, which was used for UNIX system, it has different drawbacks. It does not support structures, and did not understand datatypes. For this reason, the C language was introduced. C has high level functionality, and detailed feature for OS programming. The UNIX kernel was developed by using C.Advantages of C languageC is medium level language. It has both, the lower level and higher level functionality. We can use C to make driver or kernel level programs as well ... Read More

3K+ Views
The C Preprocessor is not a part of the compiler, but is a separate step in the compilation process. In simple terms, a C Preprocessor is just a text substitution tool and it instructs the compiler to do required pre-processing before the actual compilation. We'll refer to the C Preprocessor as CPP.All preprocessor commands begin with a hash symbol (#). It must be the first nonblank character, and for readability, a preprocessor directive should begin in the first column. The following section lists down all the important preprocessor directives −Sr.NoDirectives & Descriptions1#defineSubstitutes a preprocessor macro.2#includeInserts a particular header from another ... Read More

710 Views
The #define, const, and Enum are all used for declaring constant values, but their behaviours and use cases differ. The #define is a preprocessor directive, which is used to define a macro (it is a string or name, in which you can assign a constant value), whereas const is a keyword with which you can declare a variable with a constant value. Whereas, an Enum is a special user-defined data type that represents a group of constants. In the following article, we will learn about all three in detail. Enumeration (Enum) An Enumeration (or Enum) is a user-defined data type ... Read More

975 Views
In the following article, we will learn about short literals in C++. In both C and C++, different data types have different literals. A literal is a fixed constant value, which is assigned to the variables of different data types. For example, here is a list of different data types with their literals. Datatypes Literals ... Read More

330 Views
A complete graph is a graph which has a connecting edge between any pair of vertices. This is a C++ Program to Perform Edge Coloring on Complete Graph.AlgorithmBegin Take the input of the number of vertices ‘n’. Construct a complete graph using e=n*(n-1)/2 edges, in ed[][]. Function EdgeColor() is used to Color the graph edges. A) Assign color to current edge as c i.e. 1 initially. B) If the same color is occupied by any of the adjacent edges, then discard this color and go to flag again and try next color. ... Read More

652 Views
In this program, we will perform Edge Coloring of a Graph in which we have to color the edges of the graph that no two adjacent edges have the same color. Steps in Example.AlgorithmBegin Take the input of the number of vertices, n, and then number of edges, e, in the graph. The graph is stored as adjacency list. BFS is implemented using queue and colors are assigned to each edge. EndExample#include using namespace std; int n, e, i, j; vector g; vector color; bool v[111001]; void col(int n) { queue q; int c = ... Read More

826 Views
Vertex Cover of a Graph is to find a set of vertices V, such that for every edge connecting M to N in graph, either M or N (or both) are present in V. In this program, we Implement a Heuristic to Find the Vertex Cover of a Graph.AlgorithmBegin 1) Initialize a set S as empty. 2) Take an edge E of the connecting graph Say M and N. 3) Add both vertex to the set S. 4) Discard all edges in the graph with endpoints at M or N. 5) If some edge is ... Read More

444 Views
This is C++ Program to Generate All Subsets of a Given Set in the Lexico Graphic Order. This algorithm prints all the possible combination of each length from the given set of array in increasing order. The time complexity of this algorithm is O(n*(2^n)).AlgorithmBegin For each length ‘i’ GenAllSubset() function is called: 1) In GenAllSubset(), if currLen is more than the reqLen then return. 2) Otherwise, if currLen is equal to reqLen then there will be a new sequence generated, print it. 3) If proceed with a start as ‘true’ and recursively call GenAllSubset() with incremented ... Read More

539 Views
In this program we need to find the Edge Connectivity of a Graph. An Edge Connectivity of a Graph of a graph means it is a bridge, removing it graph will be disconnected. Number of connected components increases with the removing of bridge in a disconnected undirected graph.Functions and pseudocode:Begin Function connections() is a recursive function to find out the connections: A) Mark the current node un visited. B) Initialize time and low value C) Go through all vertices adjacent to this D) Check if the subtree rooted with x has a connection to one ... Read More