Reverse an array in C++
This post will discuss how to reverse an array in C++.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedThis post will discuss how to reverse an array in C++.
This post will discuss how to reverse a string using the stack data structure in C/C++, Java, and Python using explicit stack and call stack.
Design a stack to support an additional operation that returns the minimum element from the stack in constant time. The stack should continue supporting all other operations like push, pop, top, size, empty, etc., without degradation in these operations’ performance.
Given a binary tree, write an iterative algorithm to print the leaf-to-root path for every leaf node. Use of recursion is prohibited.
Given a binary tree, write an efficient algorithm to invert it.
The Longest Increasing Subsequence (LIS) problem is to find a subsequence of a given sequence in which the subsequence’s elements are in sorted order, lowest to highest, and in which the subsequence is as long as possible. This subsequence is not necessarily contiguous or unique.
Given a set of intervals, print all non-overlapping intervals after merging the overlapping intervals.
Given a sequence consisting of I and D, where I denotes the increasing sequence and D denotes the decreasing sequence, decode the sequence to construct a minimum number without repeated digits.
Given a binary tree, find all ancestors of a given node in it.
Given a binary tree, write an iterative and recursive solution to traverse the tree using inorder traversal in C++, Java, and Python.
Given a binary tree, write an iterative and recursive solution to traverse the tree using preorder traversal in C++, Java, and Python.
Given a binary tree, write an iterative and recursive solution to traverse the tree using postorder traversal in C++, Java, and Python.