Found 7346 Articles for C++

Difference Between Array-Based Queue and List-Based Queue

Sonal Meenu Singh
Updated on 22-Feb-2023 11:17:31

847 Views

Introduction A queue is a linear data structure that inserts and removes queue elements in a particular order. We can implement a queue in C++ by using arrays and a linked list. Both queue implementations have their benefits and uses. In this tutorial, we will differentiate the array-based Queues and List Based Queues. What is a Queue? A Queue is a series of elements that uses the FIFO principle for the insertion and deletion of its elements. A queue in Computer Science resembles the queue of real life where the one who enters first in the queue, will be removed ... Read More

How to communicate JSON data between C++ and Node.js ?

Shubham Vora
Updated on 16-Feb-2023 15:51:20

2K+ Views

C++ is a powerful, high-performance language widely used for system-level programming and applications. At the same time, Node.js is an open-source, cross-platform JavaScript runtime environment commonly used for web applications. By understanding the various methods for communicating JSON data between C++ and Node.js, developers can choose the best approach to their specific needs. In this tutorial, we will explore the various ways to communicate JSON data between a C++ application and a Node.js server. Three common approaches: using a RESTful API, using a message queue, and using a WebSocket Users can follow the steps below to communicate JSON data between ... Read More

Buffering of Blocks

Raunak Jain
Updated on 10-Jan-2023 18:25:02

2K+ Views

What is Buffering of Blocks? In computer science, buffering refers to the temporary storage of data in a buffer, or a small, fixed-sized area in memory, while it is being moved from one place to another. When data is transferred from one location to another, it is often necessary to store it temporarily in a buffer to ensure that the transfer is smooth and efficient. There are two main types of buffering: input buffering and output buffering. Input buffering refers to the temporary storage of data that is being received from an external source, such as a file on a ... Read More

B+ Tree in DBMS

Raunak Jain
Updated on 16-Jan-2023 16:02:39

2K+ Views

A B+ tree in DBMS is a specialized version of a balanced tree, a type of tree data structure used in databases to store and retrieve data efficiently. Balanced trees are designed to maintain a roughly equal number of keys at each level, which helps to keep search times as low as possible. B+ trees are a popular choice for use in database management systems(DBMS) because they offer a number of benefits over other types of balanced trees, including faster search times and better space utilization. What are B+ Trees? A B+ tree is a self-balancing, ordered tree data structure ... Read More

B*-Trees implementation in C++

Raunak Jain
Updated on 16-Jan-2023 16:03:38

824 Views

B*-Trees: An Optimized Data Structure for Fast Data Retrieval in C++ A B*-tree is a self-balancing tree data structure that is optimized for fast data retrieval. It is a variant of the B-tree, which is a tree data structure that is designed to keep its data sorted and balanced. A B-tree is characterized by the fact that it has a high degree of order, meaning that its nodes are kept sorted in a specific manner. A B*-tree is similar to a B-tree, but it is optimized for even better performance. This is achieved through the use of a number of ... Read More

C++ Program To Find the Trace and Normal of a given Matrix

Arnab Chakraborty
Updated on 14-Dec-2022 15:09:38

978 Views

Several applications greatly benefit from the use of 2-dimensional arrays or matrices. Numbers are stored in rows and columns of matrices. Using multi-dimensional arrays, we may define 2D matrices in C++ as well. In this post, we'll look at how to use C++ to determine the Normal and Trace of a given matrix. The square root of the total number of elements in the matrix is what is known as the Normal. The trace is made up of all the components that make up the main diagonal. Let's look at the representation of the algorithm in C++ code. Matrix Trace ... Read More

C++ Program to Compute the Sum of Diagonals of a Matrix

Arnab Chakraborty
Updated on 14-Dec-2022 16:04:28

5K+ Views

The utilization of 2-dimensional arrays or matrices is extremely advantageous for several applications. Matrix rows and columns are used to hold numbers. We can define 2D matrices in C++ using multi-dimensional arrays as well. In this article, we'll look at how to use C++ to calculate the diagonal sum of a given square matrix. The matrices have two diagonals, the main diagonal and the secondary diagonal (sometimes referred to as major and minor diagonals). The major diagonal starts from the top-left corner (index [0, 0]) to the bottom-right corner (index [n-1, n-1]) where n is the order of the square ... Read More

C++ Program to Compare two strings lexicographically

Arnab Chakraborty
Updated on 14-Dec-2022 14:47:45

7K+ Views

Lexicographic string comparison states the strings are compared in dictionary order. For example, if two strings ‘apple’ and ‘appeal’ are there, the first string will come next because the first three characters ‘app’ is the same. Then for the first string, the character is ‘l’ and in the second string, the 4th character is ‘e’. Since ‘e’ is shorter than ‘l’, it will come first if we arrange them in lexicographic order. Before arranging, the strings are compared lexicographically. In this article, we will see different techniques to compare two strings in a lexicographic manner using C++. Using compare() functions ... Read More

C++ Program to Print first letter of each word using regex

Arnab Chakraborty
Updated on 14-Dec-2022 14:45:07

377 Views

A useful tool for string operations is regex. This may be found in virtually all high-level current programming languages, including C++. Regular expressions (Regex) are utilized as general-purpose search patterns. For instance, by constructing a straightforward string known as a regular expression, we may implement password validation logic with at least one capital, one lowercase, one number, one special character, and a total length of at least 8 characters. In this tutorial, we'll look at how to use C++ to display only the first letters of words included within a specified string. Here, we'll look at a sentence that uses ... Read More

C++ Program to Swapping Pair of Characters

Arnab Chakraborty
Updated on 14-Dec-2022 14:39:09

2K+ Views

A string is a group of characters. They can be described as character arrays as well. An array of characters can be thought of as strings, and each string has a set of indices and values. The switching of characters at two specified indices in a string is one of the modifications we can sometimes make to strings. In this article, we will see how to swap two characters in a string from two given indices using C++. Syntax char temp = String_variable[ ] String_variable[ ] = String_variable[ ] String_variable[ ] = temp Using indices, ... Read More

Advertisements