Reverse a doubly linked list
In this post, we will see how to reverse a doubly linked list using iteration and recursion.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedIn this post, we will see how to reverse a doubly linked list using iteration and recursion.
Given an integer array, find an index that divides it into two non-empty subarrays having an equal sum.
This post will discuss how to implement two stacks in a single array efficiently.
Given a linked list of strings, check whether the concatenation of all values in the list together forms a palindrome. It is not permissible to construct a string out of the linked list nodes and check that string for palindrome.
Given a binary tree where each node has one extra pointer next, set it to the inorder successor for all binary tree nodes.
Given a binary tree, efficiently print all nodes between two given levels in a binary tree. The nodes for any level should be printed from left to right.
Given a directed graph and two vertices (say source and destination vertex), determine if the destination vertex is reachable from the source vertex or not. If a path exists from the source vertex to the destination vertex, print it.
Given a binary tree, calculate the difference between the sum of all nodes present at odd levels and the sum of all nodes present at even level.
Given two integers, find the minimum difference between their index in a given array in linear time and a single traversal of the array.
Given an integer array, partition it into two subarrays having the same sum of elements.
Given an array of distinct integers, replace each array element by its corresponding rank in the array. The minimum array element has the rank 1; the second minimum element has a rank of 2, and so on…
Print binary representation of a given number in C, C++, Java, and Python using built-in methods and custom routines.