C++ Program to Implement Queue Using Two Stacks

This is a C++ Program to implement queue using stacks. n this method, in en-queue operation, the new element is entered at the top of stack1. In de-queue operation, if stack2 is empty then all the elements are moved to stack2 and finally top of stack2 is returned. enQueue(q, x) 1) Push x to stack1 … Read more

advertisement

C++ Program to Find Lowest Common Ancestor in a Binary Search Tree

This is a C++ Program to find the Lowest Common Ancestor of a given tree. Problem Description We will be given a Binary Tree and we have to write a C++ program to find out the Lowest Common Ancestor of the two nodes of same tree taken as input from user. Lowest Common Ancestor: In … Read more

advertisement

C++ Program To Check Whether a Given Tree is Binary Search Tree

This C++ program checks whether the nodes entered form a binary search tree, a tree consisting of only two child nodes. Here is the source code of the C++ program to display whether the nodes given as input give a binary search tree as output or not. This C++ program is successfully compiled and run … Read more

advertisement

C++ Program to Implement Ternary Tree

This C++ program implements the ternary tree, is a tree data structure in which each node has at most three child nodes, usually distinguished as “left”, “mid” and “right”. Nodes with children are parent nodes, and child nodes may contain references to their parents. Here is the source code of the C++ program to display … Read more

advertisement

C++ Program to Implement Range Tree

This C++ program implements the range tree, a range tree is an ordered tree data structure to hold a list of points. Here is the source code of the C++ program to display the minimum of values present in a pre-specified range. This C++ program is successfully compiled and run on DevCpp, a C++ compiler. … Read more

advertisement

C++ Program to Implement Segment Tree

This C++ program displays the implementation of Segment Tree, a tree data structure for storing intervals, or segments. Here is the source code of the C++ program to display the sum of the elements in the specified range on giving an array of integers as input. This C++ program is successfully compiled and run on … Read more

advertisement

C++ Program to Implement Fusion Tree

This C++ program implements the fusion tree. A fusion tree is a type of tree data structure that implements an associative array on w-bit integers. Here is the source code of the C++ program to display the constructed tree and thus generated associated array of 5 bit integers on giving binary digits as input. This … Read more

advertisement

C++ Program to Implement B+ Tree

This C++ program implements the B+ Tree. A B+ tree is an n-ary tree with a variable but often large number of children per node. A B+ tree consists of a root, internal nodes and leaves. The root may be either a leaf or a node with two or more children. Here is the source … Read more

advertisement

C++ Program to Implement Triply Linked List

This C++ program implements the Triply Linked List which is a linked list which consists of three pointers which points to the element at the next and previous to it in addition to the element at the top. Here is the source code of the C++ program to display the sorted triply linked list by … Read more

advertisement

C++ Program to Implement Disjoint Set Data Structure

This C++ program implements the Disjoint Set data structure. It is a data structure that keeps track of a set of elements partitioned into a number of disjoint (nonoverlapping) subsets. Here is the source code of the C++ program to display the sum of data subsets the data strucure has been partitioned in. This C++ … Read more

advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter