← Samsung questions

Declare 2D array using pointers in C++ and find next greater element

Filed under Samsung

Dynamically allocate a 2D array of size M x N using pointers in C++ and, for each element in a 1D array, find the next greater element (the first element to the right that is larger).

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Samsung questions

Collected from public candidate posts and coding forums. Updated Nov 2026.