
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 26504 Articles for Server Side Programming

6K+ Views
The activity selection problem is a problem in which we are given a set of activities with their starting and finishing times. And we need to find all those activities that a person can do performing the single activity at a time.The greedy algorithm is appointed in this problem to select the next activity that is to be performed. Let’s first understand the greedy algorithm.Greedy Algorithm is an algorithm that tries to find the solution to a problem by finding the solution step by step. For selecting the next step, the algorithm also selected the step that seems to be ... Read More

12K+ Views
Backtracking is a technique to solve dynamic programming problems. It works by going step by step and rejects those paths that do not lead to a solution and trackback (moves back ) to the previous position.In the subset sum problem, we have to find the subset of a set is such a way that the element of this subset-sum up to a given number K. All the elements of the set are positive and unique (no duplicate elements are present).For this, we will create subsets and check if their sum is equal to the given number k. Let's see a ... Read More

444 Views
Random variables are those variables that are an outcome of the outcomes of a process that has the probability of giving rise to multiple outcomes. For example, The variable denoting head or tail as an outcome on tossing a coin is a random variable.A binomial random variable is a special type of random variable whose value is related to an event that has a fixed probability of an outcome in an event.There are certain properties that are possessed by a binomial random variable that makes it special. These are a must for a variable to become a binomial random variable ... Read More

1K+ Views
To convert a binary tree to a binary search tree, use the inorder tree traversal of the tree. In inorder traversal, we first traverse the left subtree, then the root node, and then the right subtree. The nodes in inorder traversal of a binary search tree are in ascending order, so we find the inorder traversal of binary tree, sort it in ascending order, and place the sorted nodes in binary tree using inorder traversal to get the binary search tree. Understanding Binary Tree and Binary Search Tree A binary tree is a special type of tree in which ... Read More

5K+ Views
A binary tree is a special type of tree in which each node of the tree can have at most two child nodes. These child nodes are known as right child and left child.A simple binary tree is −For representing trees, there are two ways, dynamic node representation which uses linked listSequential representation which uses array.Here, we will discuss about array representation of binary tree. For this we need to number the nodes of the BT. This numbering can start from 0 to (n-1) or from 1 to n.Lets derive the positions of nodes and their parent and child nodes ... Read More

4K+ Views
Binary search tree (BST) is a special type of tree which follows the following rules −left child node’s value is always less than the parent Noteright child node has a greater value than the parent node.all the nodes individually form a binary search tree.Example of a binary search tree (BST) −A binary search tree is created in order to reduce the complexity of operations like search, find minimum and maximum.Delete Operation binary search tree (BST)delete operation is dropping the specified node from the tree. in case deleting the nodes, there are three possibilities −Deleting a leaf node from the tree: ... Read More

2K+ Views
Binary search tree (BST) is a special type of tree which follows the following rules −left child node’s value is always less than the parent Noteright child node has a greater value than the parent node.all the nodes individually form a binary search tree.Example of a binary search tree (BST) −A binary search tree is created in order to reduce the complexity of operations like search, find minimum and maximum.Search operation in BSTPerforming a search in a binary search tree, We need to search for a key in the tree. For this, We will compare the key with the root ... Read More

2K+ Views
In this article, we are given a sorted singly linked list, and our task is to search for a given node using a binary search algorithm. The binary search algorithm works on the divide-and-conquer principle as it keeps dividing the list in half before searching. To search for an element in the linked list using binary search, it should be sorted. In the sorted linked list, we find the middle node using two pointers (slow and fast) and compare it with the target node, and based on the comparison, we either search in the left or right sub-list or return ... Read More

255 Views
A binary search known as logarithmic search is a search algorithm that searches for an element in a sorted array. The algorithm recursively divides the array into two halves, if the element is found at the mid position then return otherwise call the divide and check again until the element is found.WorkingThe algorithm works by comparing the middle element of the sorted array with the element that is to be searched.If the search element is equal to the middle element, then return the index of the element.If the search element is greater than the middle element, search in the left ... Read More

4K+ Views
Binary search is the fastest algorithm for finding an item from a sorted list of items. C++ STL provides built-in functions to perform binary search operations on sorted ranges of elements. In this article, we will learn binary_search, lower_bound and upper_bound functions in C++ STL. First of all, let's understand what binary search is. What is Binary Search? Binary search is a fast search algorithm with run-time complexity of (log n). This search algorithm works on the principle of divide and conquer, since it divides the array into half before searching. This algorithm works only on sorted collection of ... Read More