answersLogoWhite

0

#include<iostream.h>

#include<conio.h>

class add

{

int a,b,c;

public:

void input()

{

cout<<"\n *** Enter the value of a & b *** ";

cin>>a>>b;

}

void output()

{

c=a+b;

cout<<" The value of "<<a<<"+ "<<b<<" = "<<c;

}

};

void main()

{

add a1;

clrscr();

a1.input();

a1.output();

getch();

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Continue Learning about Engineering

Which is better - AVL or Red Black Trees?

It depends on what the tree is being used for. If the tree is being used to store data that is not going to be modified very much, than AVL trees are probably better. In most other cases, I'd say Red-Black trees are better.


Practical application of red black tree of data structure?

Red-black trees are typically used in real-time applications, where worst-case guarantees are vital. Red-black trees often form the basis of other tree structures, including AVL trees and LLRB trees. Computational geometry, scheduling and language dictionaries are other possible applications for RB-based trees. They are also used in functional programming as a persistent data structure.


IS AVL-Tree IS binary tree?

An AVL tree is another balanced binary search tree. Named after their inventors, Adelson-Velskii and Landis, they were the first dynamically balanced trees to be proposed. Like red-black trees, they are not perfectly balanced, but pairs of sub-trees differ in height by at most 1, maintaining an O(logn) search time. Addition and deletion operations also take O(logn) time.Definition of an AVL treeAn AVL tree is a binary search tree which has the following properties: The sub-trees of every node differ in height by at most one.Every sub-tree is an AVL tree.


What is a balanced factor in data structure?

We use the term balance when referring to balanced binary trees. These are typically implemented using red/black trees, thus ensuring every parent node has as many nodes under the left branch as it has under the right branch.


How do you identify positive terminals in voltmeters and ammeters?

The positive terminals in voltmeters and ammeters are generally indicated by a red coloring and a + (plus) symbol. Negative is generally black and - (minus).

Related Questions

What are the two groups of trees?

red oak and black oak


What are the key differences between a red-black tree and a B-tree in terms of their structure and performance characteristics?

Red-black trees are binary search trees that are balanced using color properties, while B-trees are multiway search trees that store multiple keys in each node. Red-black trees have a maximum height of 2log(n1), while B-trees have a variable height. Red-black trees are more efficient for smaller datasets, while B-trees are better for larger datasets due to their ability to store more keys in each node.


What colour is produced when mixing red plus blue plus yellow plus green plus white and black?

A weird shade of black is produced:


Does the red wire go on the plus sign on a battery or the minus?

The red wire is Positive, (+) and the Black wire is Negative. (-)


What does red plus black equal?

purple


What plus what makes red?

black + white


What are common bugs that can occur in red-black trees?

Common bugs that can occur in red-black trees include incorrect color assignments to nodes, violations of the red-black tree properties during insertion or deletion operations, and incorrect rotations or adjustments of nodes. These bugs can lead to imbalanced trees, incorrect search results, or other unexpected behavior in the tree structure.


Which is better - AVL or Red Black Trees?

It depends on what the tree is being used for. If the tree is being used to store data that is not going to be modified very much, than AVL trees are probably better. In most other cases, I'd say Red-Black trees are better.


Practical application of red black tree of data structure?

Red-black trees are typically used in real-time applications, where worst-case guarantees are vital. Red-black trees often form the basis of other tree structures, including AVL trees and LLRB trees. Computational geometry, scheduling and language dictionaries are other possible applications for RB-based trees. They are also used in functional programming as a persistent data structure.


What the name of trees has leaf morning colour white afternoon red and night black?

Leopdia


Where does the name Black come from?

The name "Black Widow" comes from the spider killing their mate, plus they are black with a red or yellow hourglass.


What is green white red black on a stereo four wire mean?

Black, ground. Red, battery plus. Green, right channel audio (plus black for the negative speaker lead), white, Left channel audio (plus black for negative speaker lead). This is assuming that you're talking about a car stereo you're trying to install.