Sudhir sharma has Published 1149 Articles

C++ Programe to find n-th term in series 1 2 2 3 3 3 4

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:14:13

375 Views

In this problem, we are given an integer N. The task is to find n-th term in series 1 2 2 3 3 3 4….Let’s take an example to understand the problem, InputN = 6Output3ExplanationThe series upto nth term is 1, 2, 2, 3, 3, 3, ...Solution ApproachA simple approach ... Read More

Find n-th node of inorder traversal in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:12:17

363 Views

In this problem, we are given a binary tree and an integer N. The task is to find the n-th node in inorder traversal of a Binary Tree.A binary tree has a special condition that each node can have a maximum of two children.Traversal is a process to visit all ... Read More

Find n-th node in Preorder traversal of a Binary Tree in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:08:15

260 Views

In this problem, we are given a binary tree and an integer N. The task is to find the n-th node in Preorder traversal of a Binary Tree.A binary tree has a special condition that each node can have a maximum of two children.Traversal is a process to visit all ... Read More

Find n-th node in Postorder traversal of a Binary Tree in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 08:33:38

165 Views

In this problem, we are given a binary tree and an integer N. The task is to find the n-th node in Postorder traversal of a Binary Tree.A binary tree has a special condition that each node can have a maximum of two children.Traversal is a process to visit all ... Read More

Find n-th element in a series with only 2 digits (and 7) allowed in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 08:28:25

251 Views

In this problem, we are given an integer N, denoting a series of numbers consisting of 4 and 7 only.The series is 4, 7, 44, 47, 74, 77, …The task is to find the n-th element in a series with only 2 digits (and 7) allowed.Let’s take an example to ... Read More

Find n positive integers that satisfy the given equations in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 08:26:15

287 Views

In this problem, we are given three values A, B and N. Our task is to Find n positive integers that satisfy the given equations.Problem Description − We need to find the N positive values that satisfy both the equations, x12 + x22 + … xn2 ≥ A x1 + ... Read More

Find N % (Remainder with 4) for a large value of N in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 08:21:40

120 Views

In this problem, we are given a string num representing a large integer. Our task is to Find N % (Remainder with 4) for a large value of N.Problem Description − we will be finding the remainder of the number with 4.Let’s take an example to understand the problem, Inputnum ... Read More

Find Multiples of 2 or 3 or 5 less than or equal to N in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 08:18:02

367 Views

In this problem, we are given a number N. Our task is to Find Multiples of 2 or 3 or 5 less than or equal to N.Problem Description − We will be counting all elements from 1 to N that are divisible by 2 or 3 or 5.Let’s take an ... Read More

Find modular node in a linked list in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 07:36:43

261 Views

In this problem, we are given a singly linked list LL and a number k. Our task is to Find modular node in a linked list.Problem Description − we need to find the last node of the linked list for which the index is divisible by k i.e. i % ... Read More

Find missing elements of a range in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 07:33:23

445 Views

In this problem, we are given an array arr[] of size n and the start and end element denoting the range. Our task is to Find missing elements of a range.Problem Description − we will be finding the elements of the range that are not present in the range.Let’s take ... Read More

Advertisements