Arnab Chakraborty has Published 4293 Articles

Maximum Length Chain of Pairs in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Sep-2019 12:32:39

188 Views

There is a chain of pairs is given. In each pair, there are two integers and the first integer is always smaller, and second one is greater, the same rule can also be applied for the chain construction. A pair (x, y) can be added after a pair (p, q), ... Read More

Tribonacci Word in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Sep-2019 12:17:14

219 Views

The Tribonacci Word is a sequence of digits. This is similar to the Fibonacci Words. Tribonacci Word is constructed by repeated concatenation of three previous stringsT(n) = T(n - 1) + T(n - 2) + T(n - 3)The first few strings to start, are {1, 12, 1213} So the next ... Read More

Tribonacci Numbers in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Sep-2019 12:13:29

2K+ Views

Here we will see how to generate the Tribonacci numbers using C++. The Tribonacci numbers are similar to the Fibonacci numbers, but here we are generating a term by adding three previous terms. Suppose we want to generate T(n), then the formula will be like below −T(n) = T(n - ... Read More

Tetranacci Numbers in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Sep-2019 12:10:21

196 Views

Here we will see how to generate the Tetranacci numbers using C++. The Tetranacci numbers are similar to the Fibonacci numbers, but here we are generating a term by adding four previous terms. Suppose we want to generate T(n), then the formula will be like below −T(n) = T(n - ... Read More

Sort the numbers according to their sum of digits in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Sep-2019 12:05:21

422 Views

In this section we will see how to sort numbers according to their sum of digits. So if a number has lesser sum of digits, then that will be placed at first, then next number will be placed with larger sum of digits.data = {14, 129, 501, 23, 0, 145}after ... Read More

Sort an array of strings according to string lengths in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Sep-2019 11:51:12

1K+ Views

Here we will see how to sort a list of strings based on their lengths. So if a string has less number of characters, then that will be placed first, then other longer strings will be placed. Suppose the strings arestr_list = {“Hello”, “ABC”, “Programming”, “Length”, “Population”}after sorting, they will ... Read More

Sort an array according to the order defined by another array in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Sep-2019 11:47:56

330 Views

In this section we will see another sorting problem. Suppose we have two arrays A1 and A2. We have to sort A1 in such a way that the relative order among the elements will be same as those are in A2. If some elements are not present in A2, then ... Read More

Sort an array according to count of set bits in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Sep-2019 11:34:23

387 Views

Here we will see one interesting problem to sort an array based on the set-bits. When an element in the array has higher number of set-bits, then that will be placed before another element which has lower number of set bits. Suppose some numbers are 12, 15, 7. So the ... Read More

Comparison of Search Trees in Data Structure

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 13:51:07

2K+ Views

Here we will see some search trees and their differences. There are many different search trees. They are different in nature. The basic search tree is Binary Search Tree (BST). Some other search trees are AVL tree, B tree, Red-Black tree, splay tree etc.These trees can be compares based on ... Read More

Adjacency lists in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 13:45:56

4K+ Views

The graph is a non-linear data structures. This represents data using nodes, and their relations using edges. A graph G has two sections. The vertices, and edges. Vertices are represented using set V, and Edges are represented as set E. So the graph notation is G(V, E). Let us see ... Read More

Advertisements