Category: c / c++
The Wiggle Sorting may produce more than one possible outcome as long as the final sorted array satisfies: nums <= nums >= nums <= nums Given an unsorted array …
Suppose if you are given an array of N integers, how could you find out the top K elements based on its frequencies? For example, Input: nums = , …
Given a 2D Matrix, return the transpose of it. The transpose of a matrix is the matrix flipped over it’s main diagonal, switching the row and column indices of …
We often need to create multi-dimensional arrays. In C/C++, depending on the memory management, this can be categorised into static arrays and dynamic arrays. How to Create 2 or …
Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node’s value equals the given …