GeeksforGeeks

A computer science portal for geeks
Register  |  Login

Given a Binary Tree where each node has following structure, write a function to populate next pointer for all nodes.

Read More »

Given an array of integers where each element represents the max number of steps that can be made forward from that element. Write a function to return the minimum number of jumps to reach the end of the array (starting from the first element).

Read More »

Write a function to count number of smaller elements on right of each element in an array.

Read More »

Difficulty Level: Rookie Given a stream of numbers, print average (or mean) of the stream at every point. For example, let us consider the stream as 10, 20, 30, 40, 50, 60, … Average of 1 numbers is 10.00 Average of 2 numbers is 15.00 Average of 3 numbers is 20.00 Average of 4 numbers [...]

Read More »

Given a sorted array. Write a function that creates a Balanced Binary Search Tree using array elements.

Read More »

Given a Singly Linked List which has data members sorted in ascending order. Construct a Balanced Binary Search Tree which has same data members as the given Linked List.

Read More »

Given an array of integers which is initially increasing and then decreasing, find the maximum value in the array.

Read More »

Write a function to connect all the adjacent nodes at the same level in a binary tree. Structure of the given Binary Tree node is like following.

Read More »

Write a function to connect all the adjacent nodes at the same level in a binary tree. Structure of the given Binary Tree node is like following.

Read More »

Given two integers k and n, write a function that prints all the sequences of length k composed of numbers 1,2..n. You need to print these sequences in sorted order.

Read More »

Why performance analysis? There are many important things that should be taken care of, like user friendliness, modularity, security, maintainability, etc. Why to worry about performance?

Read More »

Scope of an identifier is the part of the program where the identifier may directly be accessible. In C, all identifiers are lexically (or statically) scoped. C scope rules can be covered under following two categories.

Read More »

Consider the following C programs.

Read More »

Predict the output of following C++ program.

Read More »

Question: How to deallocate dynamically allocate memory without using “free()” function.

Read More »

Predict the output of following C program.

Read More »

Given an array A[0 ... n-1] containing n positive integers, a subarray A[i ... j] is bitonic if there is a k with i < = k = A[j].

Read More »

Predict the output of following C++ program.

Read More »

A function is called pure function if it always returns the same result for same argument values and it has no side effects like modifying an argument (or global variable) or outputting something.

Read More »

Predict the output of following C programs: Difficulty Level: Rookie

Read More »

Ever wondered how can you design a class in C++ which can’t be inherited. Java and C# programming languages have this feature built-in. You can use final keyword in java, sealed in C# to make a class non-extendable.

Read More »

Given a string, find the length of the longest substring without repeating characters. For example,

Read More »

Given an array of n distinct integers sorted in ascending order, write a function that returns a Fixed Point in the array, if there is any Fixed Point present in array, else returns -1.

Read More »

In the previous post on trie we have described how to insert and search a node in trie. Here is an algorithm how to delete a node from trie.

Read More »

The volatile keyword is intended to prevent the compiler from applying any optimizations on objects that can change in ways that cannot be determined by the compiler.

Read More »
Tweet