Select C++ in the visualizer, enter or paste a complete program and run it. Include int main(); its final return 0 may be omitted. Prepare inputs in the program; interactive input is not available.
The execution environment uses C++20. You may explicitly include supported standard headers such as <vector>, <algorithm> and <sstream>. Headers already provided include <algorithm>, <bitset>, <cmath>, <deque>, <map>, <numeric>, <queue>, <random>, <set>, <stack>, <string>, <unordered_map>, <unordered_set>, <utility>, <vector>. Names from std are available directly. Third-party dependencies, project-local headers, absolute paths and parent-directory include paths are outside the supported environment.
Ordinary functions, static class methods, local structs and correctly typed braced arguments can be used. Lambdas may have no captures, value captures or reference captures, following ordinary C++ type and capture rules.
Observable values include primitives, strings, arrays, source-object fields, pointers and supported forms of vector, stack, queue, set, unordered_set, map and unordered_map. Containers may be nested, subject to execution, result-size and collection-size limits.
Executing code and expanding every value are separate capabilities. For example, map<vector<int>, int> can participate in a calculation, but that container cannot currently be expanded. Its variable remains visible with an unavailable value. Library internals, private layouts, uninitialized values and unsupported representations may also be unavailable without preventing compilation. stringstream may generate a string; its internal storage is not an advertised expanded view.
ListNode<T> exposes val and next; createLinkedList(vector<T>) builds a list.TreeNode<T> exposes val, left and right. createBinaryTree(vector<T>) uses complete-tree array positions: children of index i are at 2i+1 and 2i+2, with -1 marking a missing node. This differs from compact level-order inputs used by the Python/JavaScript helpers.stay::Graph supports nodes, edges, neighbors and explicit visit markers.stack and queue operations such as push, pop, top and front. Additional creation or array-conversion helpers are not provided. See the helper reference.This environment supports algorithm observation rather than every C++20 program, object layout or library implementation. Keep inputs small enough to inspect, and follow the reported compilation, runtime or resource diagnostic. See annotations and the general usage guide.