Nishu Kumari has Published 122 Articles

Arrange consonants and vowels nodes in a linked list in C++?

Nishu Kumari

Nishu Kumari

Updated on 06-Aug-2025 11:10:56

219 Views

A singly linked list is a fundamental data structure that consists of nodes,  where each node contains a data field and a reference to the next node in the linked list. The next of the last node is null, indicating the end of the list. The given task is to rearrange the ... Read More

Alternate Primes till N in C++?

Nishu Kumari

Nishu Kumari

Updated on 05-Aug-2025 17:05:25

2K+ Views

A prime number is a number greater than 1 that is divisible only by 1 and itself. Given a number N, our task is to print all alternate prime numbers up to N. This means we skip every second prime number and only print the 1st position, 3rd position, 5th ... Read More

Alternate vowel and consonant string in C/C++?

Nishu Kumari

Nishu Kumari

Updated on 04-Aug-2025 16:36:50

417 Views

We are given a string with both vowels and consonants. Our task is to rearrange it so that vowels and consonants appear alternately, while keeping their original order within their groups. This rearrangement is only possible if the number of vowels and consonants is equal, or their difference is exactly ... Read More

Alternate Fibonacci Numbers in C++

Nishu Kumari

Nishu Kumari

Updated on 04-Aug-2025 16:24:15

702 Views

The Fibonacci sequence starts from 0 and 1, and each number is the sum of the previous two. In this problem, we are given a number n, and we need to print the first n numbers from the Fibonacci series, but only the numbers at alternate positions (like 0th, ... Read More

Add One Row to Tree in C++

Nishu Kumari

Nishu Kumari

Updated on 30-Jul-2025 19:18:18

239 Views

We are given the root of a binary tree and two integers, val and depth. The root of the binary tree is at depth 1. Our task is to add a new row of nodes with value val at the given depth. If the depth is 1, we have to ... Read More

Add n binary strings in C++?

Nishu Kumari

Nishu Kumari

Updated on 29-Jul-2025 18:52:05

271 Views

We are given n binary strings, and we need to add them together and return the result (as a binary string). A binary string is a string that consists only of the characters '0' and '1', which represent binary digits. We will add them bit by bit using binary ... Read More

Alternate Lower Upper String Sort in C++

Nishu Kumari

Nishu Kumari

Updated on 29-Jul-2025 14:28:24

603 Views

We are given a string that contains both lowercase and uppercase characters, and we have to sort them in an alternate way, meaning one lowercase letter, then one uppercase letter, then again a lowercase letter, and so on, all in sorted order within their cases. Let's understand this with a ... Read More

Adding one to number represented as array of digits in C++?

Nishu Kumari

Nishu Kumari

Updated on 29-Jul-2025 14:22:35

299 Views

In this problem, we are given a number in the form of an array, and each digit of the number is stored at one index of the array, and the most significant digit comes first. Our task is to add 1 to this number and return the updated number in ... Read More

Alternate Odd and Even Nodes in a Singly Linked List in C++

Nishu Kumari

Nishu Kumari

Updated on 29-Jul-2025 12:57:44

352 Views

Given a singly linked list, we need to rearrange its nodes so that even and odd numbers come one after the other alternatively. If the list starts with an even number, the next should be odd, then even, and so on. Similarly, if it begins with an odd number, the ... Read More

Additive Number in C++

Nishu Kumari

Nishu Kumari

Updated on 28-Jul-2025 19:30:40

668 Views

We are given a string containing only digits from 0 to 9, and we need to check whether it is an additive number. An additive number is a string that can form an additive sequence, where each number (starting from the third) is the sum of the previous two. For ... Read More

Advertisements