Aman Kumar has Published 94 Articles

C++ Program to Find Maximum Number of Edge Disjoint Paths

Aman Kumar

Aman Kumar

Updated on 30-May-2025 18:41:09

181 Views

According to the problem statement, we have a directed graph and two vertices that are source s and destination/target t. Our task is to determine the maximum number of edge-disjoint paths that can be found from vertex s to vertex t. If two paths do not share any edge, then ... Read More

Exception Handling in C++ vs Java

Aman Kumar

Aman Kumar

Updated on 30-May-2025 18:40:08

712 Views

In both languages, exception handling is used to identify errors using the try, catch, and throw keywords. Exception handling is a programming mechanism that works with errors and unexpected events that occur during program execution. Exception Handling in C++ C++ provides an inbuilt feature for handling exceptions using try and ... Read More

C++ Program to Implement Splay Tree

Aman Kumar

Aman Kumar

Updated on 30-May-2025 18:39:36

3K+ Views

Splay Tree Splay tree is a self-balanced binary searched tree. The idea of implementing the splay tree is to bring the most recently inserted element to the root of the tree by performing a sequence of tree rotations, called splaying. Following are the basic operation on AVL: ... Read More

Set position with seekg() in C++ language file handling

Aman Kumar

Aman Kumar

Updated on 30-May-2025 18:39:14

4K+ Views

The setg() function sets the position of the file pointer in the file. C++ seekg() Function The seekg() is a function in the iostream library that allows us to seek an arbitrary position in a file. It is mainly used to set the position of the next character to be ... Read More

C++ Program to Implement Randomized Binary Search Tree

Aman Kumar

Aman Kumar

Updated on 29-May-2025 15:45:27

707 Views

A Randomized Binary Search Tree (RBST) is a variation of a Binary Search Tree (BST) that contains randomization to maintain balance and improve efficiency. One common implementation of an RBST is a Treap, which combines BST properties with heap properties. Why We Use Random Binary Tree Random binary trees ... Read More

C++ Program to Implement self Balancing Binary Search Tree

Aman Kumar

Aman Kumar

Updated on 29-May-2025 15:44:52

2K+ Views

Self Balancing Binary Search tree A self-balancing binary search tree (BST) is a height-balanced binary search tree that automatically keeps its height (the maximum number of levels below the root) as small as possible when insertion and deletion operations are performed on the tree. In the self-balancing binary search tree, ... Read More

C++ Program to Implement Hash Tables with Quadratic Probing

Aman Kumar

Aman Kumar

Updated on 28-May-2025 16:51:57

2K+ Views

Hash Table A hash table is a data structure which is used to store key-value pairs and uses hash function to compute an index into an array of buckets or slots in which an element will be inserted or searched in average-case constant time. Why are Collision a Problem? A ... Read More

Variable number of arguments in C++

Aman Kumar

Aman Kumar

Updated on 28-May-2025 16:51:15

7K+ Views

Sometimes, you may come across a scenario where you want to have a function that can take a variable number of arguments, i.e., parameters, instead of a predefined number of parameters. The C/C++ programming language provides a solution for this scenario, and you are allowed to define a function that ... Read More

Pure Virtual Functions and Abstract Classes in C++

Aman Kumar

Aman Kumar

Updated on 28-May-2025 16:47:25

25K+ Views

C++ Pure Virtual FunctionsA pure virtual function in C++ is a virtual function that has no definition in the base class and must be overridden in derived classes. It is declared by assigning = 0 in its declaration. Syntax Following is the syntax of the pure virtual function: class Shape ... Read More

C++ Program to Implement Queue using Array

Aman Kumar

Aman Kumar

Updated on 28-May-2025 16:41:21

93K+ Views

A queue is a linear data structure that contains a collection of elements. Queue implements the FIFO mechanism i.e., the element that is inserted first is also deleted first. In other words, the least recently added element is removed first in a queue. Implementation Steps Based on the below implementation. ... Read More

Previous 1 ... 3 4 5 6 7 ... 10 Next
Advertisements