Trending December 2023 # History, Christmas Tree Significance, Who Is Santa? # Suggested January 2024 # Top 12 Popular

You are reading the article History, Christmas Tree Significance, Who Is Santa? updated in December 2023 on the website We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested January 2024 History, Christmas Tree Significance, Who Is Santa?

Festival of Christmas

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

Who is Jesus?

Jesus is God’s Holy Son. Jesus is also known as Jesus Christ, Jesus of Nazareth, or Jesus of Galilee. Jesus was born in Bethlehem (4 B.C.) to a virgin mother, Mary. Most Christians believe he is God’s Son and the long-awaited Messiah (the Christ) foretold in the Hebrew Bible. Jesus came to earth to witness his Father’s love and teach forgiveness. His name evokes images of peace, miracles, love, and healing. According to the Gospels, Jesus could perform miraculous feats, such as healing various diseases merely by touching or talking to people.

History of Christmas

Christmas celebrations started for the first time in 336 A.D. in Rome.

Many countries around the world celebrate Christmas. Initially, the Eastern Christian church celebrated on January 6. However, the Roman Church purposefully moved it on December 25. It was the day of the invincible sun pagan festival.

Who is Santa Claus?

Many countries still celebrate St. Nicholas Day on December 6, but in others, including the United States, the traditions associated with the day merge with Christmas.

How is Christmas Celebrated?

It starts with the house decoration with stars, colorful lights, a tree, and the Crib. Cakes and cookies get baked. Carols get ready first in the first week of December. People gather in groups and sing songs to express joy and happiness.

People go to church at night on Christmas Eve, December 24, to attend mass. Then there’s Christmas, which is on December 25. On this day, people return to church, gather with friends and family, and celebrate with a large feast.

Why is the Christmas Tree Important?

In several ancient cultures, the tree has distinct meanings and significance.

Here are a couple of such examples:

In Roman culture, evergreen trees are associated with solar symbolism, a sign of light. Saturnalia was a festival commemorating Saturn, the God of Agriculture. Romans styled their homes and temples with evergreen boughs to honor the occasion.

The tradition of decorating houses with trees attributes to Germany. It is also popularly assumed that Martin Luther was the first to decorate a tree with lit candles.

Attis revered the coniferous pine, the Greek God of Flora (the world of vegetation). Pine decks with silver adornments in Greek culture and bells and offerings set up beneath the tree as divine sacrifices.

Japanese and Chinese people regard pine and cypress trees as sacred, equating them with immortality and longevity. The wood from these trees gets utilized to build holy constructions, including altars, temples, and Shinto Kami structures. Furthermore, pine and cypress contain the life force felt when these divine constructions get created in these traditions.

Christmas Carols

Carol is a hymn about Christmas typically sung on Christmas or during the Christmas holiday. Carols got introduced to medieval chord structures that give them their characteristic melodic sound. Some carols, such as “Good King Wenceslas,” “Personent Hodie,” and “The Holly and the Ivy,” may be directly traced back to the medieval era and are among the earliest musical pieces still commonly performed.

Merry Christmas Messages

May this festival bring you and your loved ones lots of light and happiness.

Carols. A gleaming star adorns the Christmas tree. May this sparkling light your life forever!

Christmas greetings! May the festive season fill your heart and home with all the joys it provides.

I wish you a joyous and bright holiday season filled with the light of God’s love!

May your season be full of wonders and joy. Christmas greetings!

Jingle bells, jingle bells, jingle all the way, What a treat it is to have such a beautiful day today!

This greeting from my heart is warm and genuine. May your day be filled with joy and happiness.

Christmas is a time to wish one another joy, love, and peace. Merry Christmas, my beloved friends. May you feel the love on this beautiful day!

This heartfelt Christmas greeting comes from the bottom of my heart. May your day be full of happiness and joy.


Christmas is a festival celebrating the birth of Jesus Christ, enjoyed mainly on December 25 by people all over the globe as a cultural and religious festival. It is an event full of excitement and joy that people worldwide celebrate Merry Christmas and Happy Holidays!

You're reading History, Christmas Tree Significance, Who Is Santa?

Transactional Law: Meaning And Significance

A transactional lawyer, often known as a “business lawyer,” can structure complicated commercial real estate agreements, make wills and trusts, and negotiate and draft contracts. Transactional attorneys can represent both businesses and people.

What is Transactional Law?

Transactional legal work involves many different elements of business operations. This includes sales, acquisitions, and mergers. All types of professional transactions fall under this area of legal expertise. When compared to litigation practice, transactional practice typically entails handling legal issues out of court.

Transactional Law Across Jurisdictions

Transactional law practice is notable for the extent to which uniform laws and model acts control policy. The Uniform Commercial Code, enacted in every state, is an obvious example, covering sales of goods, negotiable instruments, bank deposits, and secured transactions, among other things. Other important uniform laws are those governing trade secrets, agencies, and the many varieties of partnerships.

Practice Areas of Transactional Law

Following are the major practice areas of transactional Law −

Securities Law − Stocks, bonds, and options are known as securities. Transactions involving securities are regulated by both federal and state law. At the federal level, there are six essential securities acts as well as numerous regulations and proposed regulations promulgated under their authority by the SEC. Businesses must follow the applicable law on registration of securities, financial reporting, and disclosure of the purchase or sale of securities by company insiders. The law that regulates securities is one of the most complex in the legal field.

Securities are bought and sold through two types of transactions− issuer transactions and trading transactions. An issuer transaction occurs when a business sells an interest in the company to raise capital. One example of this is an initial public offering, or IPO. Trading transactions occur between investors and involve securities that already exist. Trades that occur on a stock market are trading transactions.

The SEC generates several unique types of primary law documents. Regulatory actions taken by the agency include Interpretive Releases, Concept Releases, Policy Statements, and Exemptive Orders. In response to an enforcement action, the commission’s administrative law judges hold hearings and issue decisions on alleged securities law violations.

Corporate Governance and M&A − Corporate formation, record−keeping, accounting, decision−making, and combination often involve legal counsel, especially in large corporations. The primary authorities governing these areas of corporate conduct are varied, and can overlap with securities laws, banking and finance law, employment law, intellectual property law, and tax law. Several federal statutes are designed to prevent fraud and abuse in accounting and in corporate mergers and acquisitions.

The majority of M&A activity takes place at large and medium−sized businesses. Large businesses frequently concentrate on buying and selling public enterprises. These are typically the largest and most complicated transactions, frequently transcend international borders, and may include cash or equity considerations.

Banking and Finance Law − Banking and finance law addresses the organization, ownership, and operation of banks and depository institutions, mortgage banks, other providers of financial services regulated or licensed by state or federal banking regulators, and holding companies (“bank and other financial organizations”). It also covers representation of bank and other financial organizations in lending transactions to borrowers and compliance with consumer and other laws involving all aspects of financial services provided by bank and other financial organizations.

A bank is a financial institution that provides banking and other financial services to their customers. A bank is generally understood as an institution which provides fundamental banking services such as accepting deposits and providing loans. Banks are a subset of the financial services industry.

Intellectual Property Law − The property which comes into existence by application of human intellect is termed as Intellectual Property. Intellectual Property relates to information which can be incorporated in tangible objects and reproduced in different locations. Intellectual property rights protect the interests of creators by giving them property rights over their creations.

Intellectual Property is intangible, that is, it cannot be defined or identified by its own physical parameters. Intellectual property law includes copyright law, patent law, trademark law, and the law protecting trade secrets. It is quite a broad topic, and some even doubt the utility of categorizing these areas as “intellectual property.” That said, each area has its own regulatory structure and specialized resources.

Tax Law − The word tax is based on the latin word taxo, which means to estimate. To tax means to impose a financial charge or other levy upon a taxpayer, an individual or legal entity, by a state or the functional equivalent of a state such that failure to pay is punishable by law. Taxation is a payment from natural persons or legal entity and it is levied by government, for which no goods or services is received directly in return, so taxes is that amount of money, the people pay which is not related directly to the benefit of people obtained from the provision of a particular goods or services. Objectives of taxes have been developed when the functions of the Government are developed. In the primitive communities a member has to pay his share to the Head of the tribe, who in return provided them with administration, security from foreign aggression and other civic amenities. But today taxation besides being the main resource for supporting government has become a tool for economic growth, social welfare; attract foreigner investment, economic stability, and income distribution.


The term “transactional law” is a comprehensive term that incorporates corporation law, business law, etc. Thus, transactional processes entail gathering information, putting together documents, and analysing them for transactions at all levels involving both people and businesses. Lawyers who practice in such a transactional field, usually, do not go to court.

Frequently Asked Questions

Q. What falls under “transactional work”?

Q. What kinds of laws govern transactions?

The practise areas covered by transactional law include −

Acquisitions and mergers, business buying and selling, corporate transactions, intellectual property estate planning, employment−related business transactions, and real estate purchases and sales

Q. What distinguishes transactional law from litigation?

Litigation attorneys are necessary for lawsuits trying to succeed in court, whereas transactional attorneys work to reconcile parties and prevent further disputes. They evaluate any potential claims made by their client(s).

Q. What is the meaning of “transactional legal documents”?

Precedents (example agreements and contracts), forms, checklists, timetables, and practise notes are all included in the transactional law tools. Contracts and agreements with a history of application in past transactions are called precedents.

Q. What exactly is a “Transaction Services Agreement (TSA)?”

A transaction services agreement, sometimes known as a “TSA,” is a binding legal document signed by the buyer and the seller of a business in which the seller commits to offering the buyer particular services following the sale of the business.

Alternative Dispute Resolution Meaning Significance

Although the Indian legal system is among the oldest in the world, it is also widely acknowledged that it is becoming less effective at handling open cases. Indian courts are overburdened with protracted, unresolved issues. The situation is that despite the establishment of more than a thousand fast-track courts that have previously resolved millions of cases, the issue is still far from being resolved as backlogs of unresolved cases continue to grow.

Alternative Dispute Resolution (ADR), which settles disputes in a way that is acceptable to all parties, might be a useful tool in dealing with such a circumstance.

The public and the legal community now generally embrace alternative dispute resolution. Anyone in the United States with a civil (non-criminal) dispute has the option of using ADR instead of going to court. In some situations, courts encourage or mandate the use of ADR by the parties to a lawsuit in order to facilitate more amicable dispute resolution and lighten the caseload on the court system.

What is Alternative Dispute Resolution (ADR)?

Alternative Dispute Resolution (ADR) is the process by which issues between the parties are resolved amicably or with minimal litigation and without the involvement of judicial institutions.

ADR provides a means to resolve any form of dispute, including civil, commercial, industrial, and familial disputes in which parties are unable to initiate negotiations and come to a resolution.

A neutral third party is typically used in ADR to facilitate communication, conflict resolution, and discussion between the parties.

It is a technique that enables individuals and groups to uphold social order, promote cooperation, and lessen conflict.

ADR can play a significant role in lessening the load of litigation on the courts while providing a comprehensive and rewarding experience for the parties.

Through innovative, cooperative bargaining, it offers the chance to “expand the pie” and satisfy the motives behind their demands.

Alternative dispute resolution is frequently hailed as the finest method for resolving conflicts. Many judges, attorneys, and academics strongly support it because of its capacity to establish deals without detracting from the overburdened legal system.


Saving Time − The duration of litigation can be very long. A case may take months or even years to properly resolve, depending on the nature of the disagreement and the issues raised. The majority of alternative dispute resolution techniques, if not all of them, can be finished in a few months, if not sooner.

Surrenders Appeal − Alternative dispute resolution procedures restrict the parties’ capacity to reach a different conclusion after the process is over and a judgment has been made, in contrast to litigation, where a party may appeal a decision after it has been made. This may make the process less accessible for some people.

Saving Money − Alternative conflict resolution typically takes substantially less time than traditional dispute settlement, which results in lower costs for participants. The parties will save money on attorneys’ fees as a result of the time saved, even though arbitration or mediation may have higher fees than the judicial system. Most procedures, with the exception of arbitration, won’t require as much discovery as a trial would, which would also result in significant financial savings.

Increases Spending − Though ADR process saves money, but in the beginning of this procedure, there are greater out-of-pocket expenses than there would be with litigation. The costs of a arbitrator/s, the venue for the process, and many other expenses will be borne by the parties. It is crucial to balance the costs of the process with the costs at stake because of this.

Provides Reality − Some parties find that the longer they dwell on a disagreement, the more probable it is that they will persuade themselves that they are correct. A party may, as a result, fail to see the truth of their situation and cling to a fictitious notion of their rights. Alternative dispute resolution can frequently assist the parties in acknowledging the other party’s stance and recognizing some potential strengths to aid in better decision-making.

Encourages Compromise − The collaborative nature of alternative conflict resolution necessitates that the parties arrive at the table prepared to make some sort of concession to the other side. This outcome might be rapid, but it might not be the ideal one. When engaging in such proceedings, a party must be extremely aware of their rights.

Stays Confidentiality − Anyone can often access the public record of the legal process. Alternative dispute resolution is often private, so the conflict only affects the parties and the mediator.

Allows Power − In alternative conflict resolution, power disparities may compromise the impartiality of the procedure. For instance, if one party has greater clout, the other will frequently feel like they are making efforts to placate them rather than striking a compromise.

Feels Informal − There are alternate conflict settlement processes that are more formal. But in practice, it is frequently considerably quicker and less formal than the litigation procedure. The rules of evidence and other court regulations won’t usually be a concern for the parties.

Stalls Process − Because the process is voluntary, some parties may utilize alternative dispute resolution as a strategy to drag out the proceedings. This may be done to give the gathering of evidence more time or to make the plaintiff wait longer to receive their award. It’s crucial to recognize when someone enters a dispute resolution procedure without intending to try to settle it.

Allows Experience − In contrast to litigation, the parties can pick the neutral based on their familiarity with the issue. As a result, because they have a better understanding of the issue, the parties will frequently avoid having to explain specifics to the neutral.

Importance of ADR

ADR plays a vital role in India by using its variety of strategies to deal with the problem of cases that are pending in Indian courts. The Indian judiciary is given scientifically designed methods for alternative dispute resolution, which serves to lighten the load on the courts. ADR offers a number of ways to resolve disputes, including arbitration, conciliation, mediation, negotiation, and Lok Adalat. Negotiation in this context refers to the parties engaging in self-counseling to address their conflict; however, in India, this practice is not formally recognized.

Articles 14 and 21, which deal with equality before the law and the rights to life and personal liberty, respectively, are also the foundations of ADR. The goal of ADR is to uphold the preamble-guaranteed social, economic, and political justice as well as the integrity of society. Equal justice and free legal assistance are further goals pursued by ADR in accordance with Article 39-A of the Directive Principles of State Policy (DPSP).

Types of ADR

There are majorly four types of ADR as given below −




Lok Adalat

Let’s discuss each one of them separately −


The case is heard by an arbitral tribunal, which issues a decision (an “award”) that is largely binding on the parties.

Compared to a trial, it is less formal, and the rules of evidence are frequently loosened.

Generally speaking, an arbitrator’s ruling cannot be challenged. There is relatively limited room for judicial intervention in the arbitration process, save for a few temporary measures.


A non-binding process where a conciliator, or unbiased third party, helps the parties to a dispute come to a mutually accepted resolution.

A less formal variation of arbitration is conciliation.

The proposals of the conciliator are open for acceptance or rejection by the parties.

However, the settlement agreement put up by the conciliator will only be final and binding if both parties approve it.


In mediation, a third party called a “mediator” assists the parties while they work to resolve their differences in a way that is mutually agreeable.

Instead of making a decision on the issue, the mediator facilitates communication between the parties so that they can try to resolve it on their own.

The parties retain final decision-making authority during mediation.

Lok Adalat

Lok Adalat is one of the accepted and reliable modes of dispute resolution. It has the following features −

The emergence of voluntary organizations known as Lok Adalats (People’s Courts) is an intriguing aspect of the Indian judicial system.

To promote out-of-court settlements, the Legal Services Authorities Act was passed in 1987, and the revised Arbitration and Conciliation Act was passed in 1996.

In Lok Adalat, often known as “People’s Court,” issues are decided without excessive emphasis on legal nuances in a relaxed setting that encourages compromises in the presence of a judge.

The Lok-decision Adalat’s is final, will be regarded as a civil court’s judgment, and will bind the parties to the dispute.

Adalat’s Lok-decision cannot be challenged in court. 

Mechanism of ADR

It includes −

ADR can play a significant role in lessening the load of litigation on the courts while providing a comprehensive and rewarding experience for the parties.

Through innovative, cooperative negotiating, it offers the chance to “grow the pie” and satisfy the motives behind their requests.


In conclusion, alternative dispute resolution (ADR) is a terrific way to achieve justice. Alternative Dispute Resolution makes it simple to address problems since it is very affordable, quick, expert, accessible, and provides conciliation between parties. It also involves less formality and is less combative.

Frequently Asked Questions

Q1. What is the importance of ADR?

Ans: ADR affords disputing parties the chance to resolve their differences with the aid of an unbiased third party. Comparatively speaking, it is quicker and less expensive than going to court.

Q2. What is the scope of ADR?

Q3. How successful is ADR?

Ans: Overall, 80% of people who used alternative dispute resolution (ADR) and 91% of the people who went the courts believed that their issues would not have been resolved without ADR or a court respectively.

Q4. What makes an ADR process successful?

Ans: The applicable legislation, excluding conflicts of law, should be specified in the agreement to arbitrate. Limiting discovery is a good idea. There shouldn’t be more than twenty (20) questions in interrogatories. Depositions are only permitted for witnesses who refuse or are unable to appear voluntarily.

Q5. What is the nature of ADR?

Ans: Alternative dispute resolution (ADR) is intended to resolve conflicts without the involvement of a judge or jury (outside the court of law). This route is typically open whenever efforts between the client and the insurer to address any disagreements among themselves have failed and come to a standstill.

Binary Search Tree In Java

Definition of Binary Search Tree

A binary search tree is a data structure that allows us to keep a sorted list of numbers in a short amount of time. It is also called a binary tree because each tree node can only have two siblings. The binary search tree may be used to search for the presence of a number; it is termed a search tree. The running time complexity is O(log(n)) time; the characteristics that distinguish a binary search tree from a basic binary tree are as follows –

Start Your Free Software Development Course

1. The nodes of the left subtree are all smaller than the root node.

2. The nodes of the right subtree are all greater than the root node.

3. Each node of the subtrees is likewise BSTs, meaning they have the same two qualities as the node itself.

Working on the binary search tree in Java

1. Let the specified array is:

Given array: [8, 6, 2, 7, 9, 12, 4, 10]

2. Let’s start with the top element 43. Insert 43 as the tree’s root.

3. If the next element is less than the root node element, it should be inserted as the root of the left sub-tree.

4. If not, it should be inserted as the root of the right sub-tree.

The image below depicts the process of constructing a binary search tree using the provided elements.

Binary search tree operations:

The operations supported by the binary search tree in Java are shown in the below list –

1. Searching in BST – In a binary search tree, finding the position of a certain element.

2. Insertion in BST – Adding a new element to the binary search tree in the proper location ensures that the binary search tree property is not broken.

3. Deletion in BST – Remove a specific node in a binary search tree. However, depending on the number of children a node has, there can be a variety of deletion scenarios.

Examples Example #1

// The program can be tested in Eclipse IDE, JAVA 11

package jex; import java.util.Scanner; class binarySearchTree { class Node { int key; Node left, right; public Node(int data){ key = data; left = right = null; } } Node root; binarySearchTree(){ root = null; } void deleteKey(int key) { root = delete(root, key); } Node delete(Node root, int key) { if (root == null) return root; if (key < root.key) root.left = delete(root.left, key); root.right = delete(root.right, key); else { if (root.left == null) return root.right; else if (root.right == null) return root.left; root.key = minKey(root.right); root.right = delete(root.right, root.key); } return root; } int minKey(Node root) { int min = root.key; while (root.left != null) { min = root.left.key; root = root.left; } return min; } void insertKey(int key) { root = insert(root, key); } Node insert(Node root, int key) { if (root == null) { root = new Node(key); return root; } if (key<root.key) root.left = insert(root.left, key); root.right = insert(root.right, key); return root; } void inorder() { inorder(root); } void inorder(Node root) { if (root != null) { inorder(root.left); System.out.print(root.key + " "); inorder(root.right); } } boolean searchKey(int key) { root = search(root, key); if (root!= null) return true; else return false; } Node search(Node root, int key) { return root; return search(root.left, key); return search(root.right, key); } } public class client{ public static void main(String[] args) { binarySearchTree t = new binarySearchTree(); t.insertKey(8); t.insertKey(6); t.insertKey(2); t.insertKey(7); t.insertKey(9); t.insertKey(12); t.insertKey(4); t.insertKey(10); System.out.println( "The binary search tree created with the input data :"); t.inorder(); System.out.println( "nThe binary search tree after deleting 4 leaf node :"); t.deleteKey(4); t.inorder(); System.out.println( "nThe binary search tree after Delete 12 node with 1 child is :"); t.deleteKey(12); t.inorder(); boolean res = t.searchKey (9); System.out.println( "n The node 9 found in binary search tree is :" + res ); res = t.searchKey (12); System.out.println( "n The node 10 found in binary search tree is :" + res ); } }


As in the above program, the binarySearchTree class is created, which contains another inner class Node and also contains the constructor and methods. The methods defined in the class are deleteKey(), delete(), minKey(), insertKey(), insert(), inorder(), searchKey(), and search() to perform the specific operations. In the main function, the binarySearchTree class object is created, insert some elements into it, and next call the methods of the binary Search Tree class on its object, as seen in the above output.


The binary search tree is also known as a binary tree because each tree node can only have two siblings. A binary search tree is a data structure that allows keeping a sorted list of numbers in a short amount of time. The operation that can be performed on the binary search tree: traversing, inserting, deleting, and searching.

Recommended Articles

This is a guide to Binary Search Tree in Java. Here we discuss the Definition, working of the binary search tree in Java, and examples with code implementation. You may also have a look at the following articles to learn more –

Kruskal’s Minimum Spanning Tree Algorithm

Adjacency matrix

Output: Edge: B–A And Cost: 1 Edge: E–B And Cost: 2 Edge: F–E And Cost: 2 Edge: C–A And Cost: 3 Edge: G–F And Cost: 3 Edge: D–A And Cost: 4 Total Cost: 15

Algorithm kruskal(g: Graph, t: Tree)

Input − The given graph g, and an empty tree t

Output − The tree t with selected edges

Begin    create set for each vertices in graph g    for each set of vertex u do       add u in the vertexSet[u]    done    sort the edge list.    count := 0    while count <= V – 1 do    //as tree must have V – 1 edges       ed := edgeList[count]         if the starting vertex and ending vertex of ed are in same set then          merge vertexSet[start] and vertexSet[end]          add the ed into tree t       count := count +1    done #define V 7 #define INF 999 using namespace std; int costMat[V][V] = {    {0, 1, 3, 4, INF, 5, INF},    {1, 0, INF, 7, 2, INF, INF},    {3, INF, 0, INF, 8, INF, INF},    {4, 7, INF, 0, INF, INF, INF},    {INF, 2, 8, INF, 0, 2, 4},    {5, INF, INF, INF, 2, 0, 3},    {INF, INF, INF, INF, 4, 3, 0} }; typedef struct {    int u, v, cost; }edge; void swapping(edge &e1, edge &e2) {    edge temp;    temp = e1;    e1 = e2;    e2 = temp; } class Tree {    int n;    edge edges[V-1];    //as a tree has vertex-1 edges    public:       Tree() {          n = 0;       }       void addEdge(edge e) {          edges[n] = e;            n++;       }       void printEdges() {    //print edge, cost and total cost          int tCost = 0;          for(int i = 0; i<n; i++) {             cout << "Edge: " << char(edges[i].u+'A') << "--" <<char(edges[i].v+'A');             cout << " And Cost: " << edges[i].cost << endl;             tCost += edges[i].cost;          }          cout << "Total Cost: " << tCost << endl;       } }; class VSet {    int n;    int set[V];    //a set can hold maximum V vertices    public:       VSet() {          n = -1;       }       void addVertex(int vert) {          set[++n] = vert;    //add vertex to the set       }       int deleteVertex() {          return set[n--];       }       friend int findVertex(VSet *vertSetArr, int vert);       friend void merge(VSet &set1, VSet &set2); }; void merge(VSet &set1, VSet &set2) {    //merge two vertex sets together       set1.addVertex(set2.deleteVertex());       } int findVertex(VSet *vertSetArr, int vert) {    //find the vertex in different vertex sets    for(int i = 0; i<V; i++)       for(int j = 0; j<=vertSetArr[i].n; j++)          if(vert == vertSetArr[i].set[j])             return i;   } int findEdge(edge *edgeList) {    //find the edges from the cost matrix of Graph and store to edgeList    int count = -1, i, j;    for(i = 0; i<V; i++)       for(j = 0; j<i; j++)          if(costMat[i][j] != INF) {             count++;                         edgeList[count].u = i; edgeList[count].v = j;             edgeList[count].cost = costMat[i][j];          }    return count+1; } void sortEdge(edge *edgeList, int n) {    //sort the edges of graph in ascending order of cost    int flag = 1, i, j;    for(i = 0; i<(n-1) && flag; i++) {         flag = 0;       for(j = 0; j<(n-i-1); j++)             swapping(edgeList[j], edgeList[j+1]);             flag = 1;          }    } } void kruskal(Tree &tr) {    int ecount, maxEdge = V*(V-1)/2;      edge edgeList[maxEdge], ed;    int uloc, vloc;    VSet VSetArray[V];    ecount = findEdge(edgeList);    for(int i = 0; i < V; i++)       VSetArray[i].addVertex(i);    //each set contains one element    sortEdge(edgeList, ecount);      //ecount number of edges in the graph    int count = 0;    while(count <= V-1) {       ed = edgeList[count];       uloc = findVertex(VSetArray, ed.u);       vloc = findVertex(VSetArray, ed.v);       if(uloc != vloc) {    //check whether source abd dest is in same set or not          merge(VSetArray[uloc], VSetArray[vloc]);          tr.addEdge(ed);       }       count++;    } } int main() {    Tree tr;    kruskal(tr);    tr.printEdges(); } Output Edge: B--A And Cost: 1 Edge: E--B And Cost: 2 Edge: F--E And Cost: 2 Edge: C--A And Cost: 3 Edge: G--F And Cost: 3 Edge: D--A And Cost: 4 Total Cost: 15

Binary Tree In Data Structure (Example)

What is a Binary Tree?

The word binary means two. In the tree data structure “Binary Tree”, means a tree where each node can have a maximum of two child nodes (left and right nodes). It is a simple binary tree.

However, there’s another binary tree that is used most frequently and has several use cases. It’s called the Binary Search Tree (BST). This tree can make the search algorithm way faster, precisely log(n) time complexity. In the data structure, n means the number of nodes in the binary tree.

What are the Differences Between Binary Tree and Binary Search Tree?

The difference between the BST and regular Binary tree is in the BST left node has a smaller value than the root node, and the right node has a larger value than the root node. So, the left subtree will always contain a smaller value than the root, and the right subtree will always contain a larger value than the root.

In this Algorithm tutorial, you will learn:

Example of Binary Search Trees

Let’s have the following example for demonstrating the concepts of the Binary Search Tree.

Here you can all the nodes follow the given discipline. There’s a formula for the maximum number of nodes in the Binary Search Tree. If we observe the above tree, we can see each node has two children except all the leaf nodes. And the height(h) of the given Binary Tree is 4. The formula is 2h – 1. So, it gives 15.

The above given image is not a complete Binary Tree or Balanced Binary Tree, is called the Complete Binary tree or Balanced Binary Tree. There’s another Data Structure called AVL (another type of Binary Tree) that optimizes the height of Binary Tree and performs search faster for the BST like in Fig 3.

Try to calculate the in-order traversal of the Binary Tree given above. You’ll find that it will give a non-decreasing sorted array, and Traversal algorithms will be the same as the Binary Tree.

Types of Binary Tree:

Here are some important types of Binary Tree:

Full Binary Tree: Each node can have 0 or 2 child nodes in this binary tree. Only one child node is not allowed in this type of binary tree. So, except for the leaf node, all nodes will have 2 children.

Full Binary Tree: Each node can have 0 or 2 nodes. It seems like the Full Binary Tree, but all the leaf elements are lean to the left subtree, whereas in the full binary tree node can be in the right or left subtree.

Perfect Binary Tree: All the nodes must have 0 or 2 nodes, and all the leaf nodes should be at the same level or height. The above example of a full binary tree structure is not a Perfect Binary Tree because node 6 and node 1,2,3 are not in the same height. But the example of the Complete Binary Tree is a perfect binary tree.

Degenerate Binary Tree: Every node can have only a single child. All the operations like searching, inserting, and deleting take O(N) time.

Balanced Binary Tree: Here this binary tree, the height difference of left and right subtree is at most 1. So, while adding or deleting a node, we need to balance the tree’s height again. This type of Self-Balanced Binary Tree is called the AVL tree.

There are three basic operations of BST. Those are discussed in detail below.

Implementation of Binary Tree in C and C++:

using namespace std; struct Node { int value; struct Node *left, *right; } struct Node *getEmptynode(int val) { struct Node *tempNode = (struct Node *)malloc(sizeof(struct Node)); return tempNode; } struct Node *successor(struct Node *node) { struct Node *present = node; { } return present; } struct Node *insert(struct Node *node, int value) { if (node == NULL) { return getEmptynode(value); } { } else { } return node; } int searchInBST(struct Node *node, int value) { struct Node *current = node; { { } else { } if (current == NULL) { return 0; } } return 1; } void inorder(struct Node *root) { if (root != NULL) { } } struct Node *deleteNode(struct Node *node, int value) { if (node == NULL) { return node; } { } { } else { { free(node); return temp; } { free(node); return temp; } } return node; } int main() { struct Node *root = NULL; root = insert(root, 8); root = insert(root, 4); root = insert(root, 12); root = insert(root, 2); root = insert(root, 6); root = insert(root, 10); root = insert(root, 14); root = insert(root, 1); root = insert(root, 3); root = insert(root, 5); root = insert(root, 7); root = insert(root, 9); root = insert(root, 11); root = insert(root, 13); root = insert(root, 15);

cout << “InOrder Traversal after inserting all nodes: ” << endl; inorder(root); root = insert(root, -10); cout << “nInOrder Traversal after inserting -10 : ” << endl; inorder(root); cout << “nSearching -5 in the BST: ” << searchInBST(root, -5) << endl; cout << “Searching -10 in the BST: ” << searchInBST(root, -10) << endl; root = deleteNode(root,8); cout<<“After deleting node 8, inorder traversal: “<<endl; inorder(root); root = deleteNode(root,-10); cout<<“nAfter deleting node -10, inorder traversal: “<<endl; inorder(root); }


InOrder Traversal after inserting all nodes: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 InOrder Traversal after inserting -10 : 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Searching -5 in the BST: 0 Searching -10 in the BST: 1 After deleting node 8, inorder traversal: -10 1 2 3 4 5 6 7 9 10 11 12 13 14 15 After deleting node -10, inorder traversal: 1 2 3 4 5 6 7 9 10 11 12 13 14 15 Implementation of Binary Tree in Python class Node: def __init__(self,value): chúng tôi = None self.right = None self.value = value def insert(root,value): if root == None: return Node(value) if value< root.value: chúng tôi = insert(root.left,value) else: root.right = insert(root.right,value) return root def searchInBST(root,value): current = root while current.value != value: current = current.left else: current = current.right if current == None: return "Not found" return "Found" def inorder(root): if root != None: inorder(root.left) print(root.value,end=" ") inorder(root.right) def successor(root): present = root while present != None and chúng tôi != None: present = present.left return present def deleteNode(root,value): if root == None: return root if value < root.value: chúng tôi = deleteNode(root.left, value) root.right = deleteNode(root.right, value) else: if chúng tôi == None: temp = root.right root = None return temp elif root.right == None: temp = root.left root = None return temp temp = successor(root.right) root.value = temp.value root.right = deleteNode(root.right, temp.value) return root root = Node(8) root = insert(root, 4) root = insert(root, 12) root = insert(root, 2) root = insert(root, 6) root = insert(root, 10) root = insert(root, 14) root = insert(root, 1) root = insert(root, 3) root = insert(root, 5) root = insert(root, 7) root = insert(root, 9) root = insert(root, 11) root = insert(root, 13) root = insert(root, 15) print("InOrder Traversal after inserting all nodes: ") inorder(root) root = insert(root, -10) print("nInOrder Traversal after inserting -10 : ") inorder(root) print("nSearching -5 in the BST: ",searchInBST(root, -5)) print("Searching -5 in the BST: ",searchInBST(root, -10)) root = deleteNode(root,8) print("After deleting node 8, inorder traversal:") inorder(root) root = deleteNode(root,-10) print("nAfter deleting node -10, inorder traversal:") inorder(root)


InOrder Traversal after inserting all nodes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 InOrder Traversal after inserting -10 : -10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Searching -5 in the BST: Not found Searching -5 in the BST: Found After deleting node 8, inorder traversal: -10 1 2 3 4 5 6 7 9 10 11 12 13 14 15 After deleting node -10, inorder traversal: 1 2 3 4 5 6 7 9 10 11 12 13 14 15 Application of Binary Tree:

Here are some common applications of Binary Tree:

Organizing node data in sorted order

Used in the map and set node objects in programming language libraries.

Searching for elements in the data structures

» Learn our next tutorial about Combination Algorithm

Update the detailed information about History, Christmas Tree Significance, Who Is Santa? on the website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!