 |
Introduction
Here is the code for a threaded binary tree.
The basic difference between a binary tree and the threaded binary tree is that in the binary trees the nodes are null if there is no child associated with it and so there is no way to traverse back.
But in a threaded binary...
By aisha.ansari84
Last Message By mukeshsoftona
|
8 27,838 |
 |
All possible combinations of a string
1. Finds all possible cominations of a given string. The total number of combinations with recurrences is the factorial of the string length.
2. Have given the word 'post' as an example since if I included a cin >> word; then a user may unconscientiously...
By anjanesh
Last Message By radams
|
20 37,909 |
 |
Introduction
Here is a code in which i have created for the string class. This article tells how we can implement the functions of a string through making it a class.
//Header Files
# include "classfile.h"
By arbaz.it
Last Message By aisha.ansari84
|
6 3,299 |
 |
Definition : Class which Can't be inherited by other class, that class is called final class.
You all knows that final class is inbuilt in java. But in C++ you have to create final class.Two types of Final class, you can create . One who want to create object of final class on Heap and other who...
By asadullah.ansari
Last Message By shzlw
|
6 17,619 |
 |
Originally written by Zeeshan Amjad
Assumption: 32-bit Machine.
Here I am going to explain How Virtual table, Virtual pointer for Virtual functions are internally working.
First we have understand memory layout.
Example 1: How the class's memory layout
class Test
By asadullah.ansari
Last Message By talk2mohdsaif
|
48 28,689 |
 |
This is very simple if you think in a simple manner.
A magic square is represented in a matrix form. May be all of you know this formula to satisfy magic square rule i.e. for size of matrix n*n sum of each row or column or diagonal should be n/2.
means for n=3 , sum(row or column or diag)...
By asadullah.ansari
Last Message By deniz
|
34 16,536 |
 |
This is just for a kind of information.
Here I am going to explain how to make a class so that user can create object
of it on free List( heap memory) or Stack.
Example 1: Object should be created Only On Heap memory.Idea is that make
constructor as private so that no one create on stack....
By asadullah.ansari
Last Message By shabbir
|
5 8,410 |
 |
Background
Normally most of software Engineer uses singleton design pattern in daily coding life. It's very simple , vast uses but still i saw in many softwares which is not handled proper in C++ based products/projects. One thing more you can'nt design singleton as perfectly behaved singleton....
By asadullah.ansari
Last Message By madlex
|
10 4,196 |
 |
If two process are there and one shared memory is there. One wants to write the data and another wants to read the data to the shared memory.
I have written a program in which if process1 is writing to shared memory another will wait and vise varsa. To undersand these programs one should have...
By bashamsc
Last Message By banty_raju123
|
34 44,122 |
 |
I will explain how to create a directory in linux using a c++ program.
The program to create a directory is as follows:
#include<iostream.h>
#include<sys/stat.h>
#include<sys/types.h>
using namespace std;
main()
By bashamsc
Last Message By bc.jat11
|
16 47,977 |
 |
Introduction
This article discusses about the Two Dimensional To Three Dimensional conversion and vice versa in c++
The following program converts two dimensional array to three dimensional array using TwoDimToThree() and converts three dimensional array to two dimensional array ussing...
By bashamsc
Last Message By shabbir
|
2 5,771 |
 |
Printing the date from starting date to ending date
The program takes the starting date and ending date as inputs and prints the dates in between them.This program is useful if u r dealing with dates.
The code
I have used four date functions i.e date1() , date2() , date3() , date4(). When...
By bashamsc
Last Message By shabbir
|
8 2,685 |
 |
Another method for printing the date from starting to ending
This method is useful if u r dealing with dates.If u want to do some operation using the date and then fetch another date and do vice versa it is useful.
#include<iostream>
#include<malloc.h>
using namespace std;
int ...
By bashamsc
Last Message By shabbir
|
1 2,043 |
 |
We recently saw a tutorial on Vectors in C++. Now its time for better things. So we all know what a set is. It is a group of elements in which there is no duplicate.
Consider we need a container with following features:
-> add an element, but do not allow duplicates
-> remove elements
-> get...
By blitzcoder
Last Message By GIRUM
|
2 1,820 |
 |
We have all been using screensaver's since the time we first entered the world of computers. Everyone of us must have thought how one can make a screensaver of his/her own. Screensavers were originally meant to prevent damage to phosphorus coated computer screens. Now they are mostly used for...
By blitzcoder
Last Message By shabbir
|
1 6,966 |
 |
We have all read about C++ Standard Template Library. It provides generic code for data types. Like vectors, pairs, list, sets, maps, etc. Today we'll take a good look into Vectors.
VECTOR
We have all been using arrays to store elements. But you must have thought at one point or another,...
By blitzcoder
Last Message By shabbir
|
3 2,337 |
 |
I thought of adding this small code snippets to thelibrary which just reverses the content of the array. Not sort in ascending/descending order, but put last array entry to first, etc. EG.. if array consists of {2,3,4,7,12,98},, need to output {98, 12,7,4,3,2}
#include <iostream.h>
#define...
By coderzone
Last Message By blessiepasag
|
9 6,008 |
 |
Complete Binary tree program done in C++ including Inorder, Preorder and Postorder Traversal.
#include <iostream.h>
#include <stdlib.h>
enum {TRUE = 1,FALSE = 0};
typedef struct _node
{
By coderzone
Last Message By shabbir
|
2 13,738 |
 |
Finds INTEGRAL of f(x) by Trapezoidal and Simpson method Simultaneously
TRAPEZOIDAL RULE :-
Integral of F(x) in between the limits a and b is given by
=(h/2)*(y+2(y+y+y+..y)+y)
where y=F(x),
x=x+h,
h=(b-a)/n.
By coderzone
Last Message By shabbir
|
3 3,209 |
 |
Find roots of any linear algebraic nth order equation by Regula Falsi method
The Code
#include <stdio.h>
#include <conio.h>
#include <math.h>
#define ACC 0.00001
#define N 10
By coderzone
Last Message By shabbir
|
1 2,284 |