## Given only a pointer/reference to a node to be deleted in a singly linked list, how do you delete it?

Given a pointer to a node to be deleted, delete the node. Note that we don’t have pointer to head node. Recommended: Please solve it… Read More »

## Write a function to get Nth node in a Linked List

Write a GetNth() function that takes a linked list and an integer index and returns the data value stored in the node at that index… Read More »

## Print all the duplicates in the input string

Algorithm: Let input string be “geeksforgeeks”
1: Construct character count array from the input string.

count[‘e’] = 4
count[‘g’] = 2
count[‘k’] = 2
……
2: Print all the indexes from the constructed array which have value greater than 0.

## Remove duplicates from a given string

Below are the different methods to remove duplicates in a string. METHOD 1 (Simple) filter_none edit close play_arrow link brightness_4 code // CPP program to… Read More »

## Write a program to calculate pow(x,n)

Given two integers x and n, write a function to compute xn. We may assume that x and n are small and overflow doesn’t happen.… Read More »

## Java Program for Sum the digits of a given number

Given a number, find sum of its digits. Example : Input : n = 687 Output : 21 Input : n = 12 Output :… Read More »

## C Program for Sum the digits of a given number

Given a number, find sum of its digits. Example : Input : n = 687 Output : 21 Input : n = 12 Output :… Read More »

## Program for Sum the digits of a given number

Given a number, find sum of its digits. Examples : Input : n = 687 Output : 21 Input : n = 12 Output :… Read More »

## How will you print numbers from 1 to 100 without using loop?

If we take a look at this problem carefully, we can see that the idea of “loop” is to track some counter value e.g. “i=0”… Read More »

## Return maximum occurring character in an input string

Write an efficient function to return maximum occurring character in the input string e.g., if input string is “test” then function should return ‘t’. Recommended:… Read More »