C++

Height of Binary Tree in C/C++ — step-by-step Programming tutorial on Progressive Robot

Height of Binary Tree in C/C++

The height of a Binary Tree is defined as the maximum depth of any leaf node from the root node. That is, it is the length of the longest path from the root node to any leaf node. Let us consider the below Binary Tree. Since the leaf nodes corresponding to the maximum depth are […]

Read more
Using INT_MAX and INT_MIN in C/C++ — step-by-step Programming tutorial on Progressive Robot

Using INT_MAX and INT_MIN in C/C++

URL: https://www.progressiverobot.com/int-max-min-c-plus-plus/ In this article, we'll take a look at using INT_MAX and INT_MIN in C/C++. These are actually useful macros which represent the maximum and minimum integer values. Let's take a look at it, using some examples. Using INT_MAX and INT_MIN INT_MAX is a macro which represents the maximum integer value. Similarly, INT_MIN represents […]

Read more
Level Order Traversal in a Binary Tree — step-by-step Programming tutorial on Progressive Robot

Level Order Traversal in a Binary Tree

URL: https://www.progressiverobot.com/level-order-traversal-in-a-binary-tree/ Level Order Traversal is one of the methods for traversing across a Binary Tree. In this article, we shall look at how we can implement this algorithm in C/C++. But before that, let us have our concepts covered. Building the concepts A Binary Tree is a data structure where every node has at-most […]

Read more
Using the puts() function in C/C++ — step-by-step Programming tutorial on Progressive Robot

Using the puts() function in C/C++

URL: https://www.progressiverobot.com/puts-function-c-plus-plus/ Introduction Hello reader! Today in this tutorial we are going to discuss about the vastly used puts() function in for both C and C++ programming languages. Even though the printf() and cout functions in both C and C++ are prominent for printing variables, numbers, lines, etc. they ultimately lack behind while printing strings […]

Read more
How to Create a Random Number Generator in C++ — step-by-step Programming tutorial on Progressive Robot

How to Create a Random Number Generator in C++

URL: https://www.progressiverobot.com/random-number-generator-c-plus-plus/ In this article, we'll go over the functions needed to create a random number generator in C++. In the world of computers, random numbers form an essential component to add the flavor of anonymity and security. A random number generator forms the backbone of creating pseudo-random numbers. The idea behind pseudo-random numbers is […]

Read more
How to Return an Array in a C++ Function — step-by-step Programming tutorial on Progressive Robot

How to Return an Array in a C++ Function

URL: https://www.progressiverobot.com/return-array-in-c-plus-plus-function/ Introduction In this tutorial, we are going to understand how we can return an array from a function in C++. Methods to Return an Array in a C++ Function Typically, returning a whole array to a function call is not possible. We could only do it using [pointers](/community/tutorials/pointers-in-c-and-c-plus-plus). Moreover, declaring a function with […]

Read more
3 Ways to Compare Strings in C++ — step-by-step Programming tutorial on Progressive Robot

3 Ways to Compare Strings in C++

Introduction In this article, you will learn methods to compare strings in C++. Strings in C++ can be compared using one of the following techniques: String strcmp() function built-in compare() function C++ Relational Operators (==, !=) 1. Using the String strcmp() function in C++ C++ String has built-in functions for manipulating data of String type. […]

Read more
Convert String to Char Array and Char Array to String in C++ — step-by-step Programming tutorial on Progressive Robot

Convert String to Char Array and Char Array to String in C++

In this article, we will be focusing on the different ways to convert String to char array and char array to String in [C++](/community/tutorials/c-plus-plus). While dealing with String data, we may need to convert the string data items to character array and vice-versa. This tutorial will help you solve exactly that. Convert String to Char […]

Read more
Using sort() in C++ std Library — step-by-step Programming tutorial on Progressive Robot

Using sort() in C++ std Library

URL: https://www.progressiverobot.com/sort-in-c-plus-plus/ Introduction Hey there! Today we are going to discuss the sort() function in the std library in C++. For basics, Sorting is any process of ordering items systematically. These items could be elements of a sequence or any [data structure](/community/tutorials/data-structure-algorithms). In C++, the standard library provides a pre-defined and ready to use function […]

Read more
CHAT