
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

242 Views
The median is defined as the middle value of a sorted list of numbers, and the middle value is found by ordering the numbers in ascending order. Once the numbers are ordered, the middle value is called the median of the given data set. Here, in this article, we have two different sorted arrays and need to find the median of these two array using binary search. Median depends on the sorted combined array. So, the following cases may occur: If the length of the combined array is odd, then the median should be the ... Read More

326 Views
In this articles we will find the kth Smallest Element by Partitioning the Array in C++, let's see input/output scenario: Input / Output Scenario Following is the input-output scenario: Input: arr[] = {7, 2, 1, 6, 8, 5, 3, 4} Output: 3 In the above scenario, after sorting the array, it becomes {1, 2, 3, 4, 5, 6, 7, 8}, so the kth smallest element is 3. An array is a linear data structure that is a collection of elements of the same type in a contiguous memory location. So, to partition a given array, we need to use ... Read More

222 Views
Double Order Traversal Double order traversal means each node in a tree is traversed twice in a particular order. A binary tree is a non-linear data structure where each node contains at most two children (i.e, left and right). Therefore, suppose we have a given binary tree, and the task is to find its double-order traversal. A double order traversal is a tree traversal technique in which every node traverses twice in the following order: Visit the node. Traverse the left subtree. Visit the node. ... Read More

436 Views
Cartesian Tree in C++A Cartesian tree is a binary tree derived from a sequence of distinct numbers. To construct a Cartesian tree, set its root to be the minimum number in the sequence, and then recursively construct its left and right subtrees from the subsequence before and after this number. A Cartesian tree is a tree data structure that obeys the following structural invariants: The tree follows the min (or max) heap property - each node is less than or greater than its children. An inorder traversal of the nodes causes the values in the same order in which they arise in the initial series. Let's construct a max-heap ... Read More

3K+ Views
A B+ tree is an m-tree that consists of a root, internal nodes, and leaves. The root may be a leaf or a node with two or more children. A B+ tree is an advanced data structure that extends the B-tree by adding a linked list of leaf nodes. A B+ tree can be a B-tree where each node contains only keys (not key-value pairs). What is B+ Tree? A B+ tree is a self-balancing tree data structure that maintains sorted data and allows for efficient insertion, deletion, and search operations. It differs from a B-tree in the following ways: ... Read More

205 Views
The median is defined as the middle value of a sorted list of numbers, and the middle value is found by ordering the numbers in ascending order. Once the numbers are ordered, the middle value is called the median of the given data set. Here, in this article, we have two different sorted arrays and need to find the median of the array that is formed after merging of two given arrays. Median depends on the sorted merged array. So, the following cases may occur: If the length of the merged array is odd, then ... Read More

7K+ Views
In C++, a Binary tree is a generalization of the Binary Search Tree (BST). A B-tree can have more than two children. It is also known as a balanced tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. It is optimized for a system that reads and writes large blocks of data. Properties of B-tree As we discussed in the introduction B-tree is self-balanced tree where a node can have multiple children. It maintains the balance by making sure that all leaf nodes are at the same level. Following is the properties ... Read More

3K+ Views
A linked list is a linear data structure in which we store a sequence of elements, where each element is called a node that contains data and a pointer (or link) to the next element in the sequence. In this C++ article, we will implement a Binary search tree using a linked list. Binary Search Tree A binary search tree is a hierarchical data structure that is constructed by nodes. Each node contains a value and its reference to the left and right child nodes. So the value in the left child node is less than the parent node, and ... Read More

817 Views
The inverse count of an array indicates how far or how close the array is from being sorted. If the array is already sorted, then the inverse count is zero, but if the array is sorted in reverse order, then the inverse count is maximum. Here we have given an integer array of size n and need to find the inversions in the array. If two array elements arr[i] and arr[j] form an inversion if arr[i]>arr[j] and i

248 Views
In C++, Exception Handling is a process to handle runtime errors. Exception is an event which is thrown at runtime in C++. All exceptions are derived from std::exception class. It is a runtime error which can be handled. It prints exception message and terminates the program, if we don't handle the exception.Exceptions are defined in C++ standard as class that we can use inside our programs. The arrangement of parent-child class hierarchy has been shown below −Common exception classes in C++ are −Sr.No.Exception & Description1std::exceptionThis is an exception and parent class of all the standard C++ exceptions.2std::bad_castIt is an ... Read More