Tag: stack
Return the preorder traversal of a binary tree’s nodes’ values. The pre-order displays the root/current node’s value first, then recursively calling into its left sub tree and right sub …
Given a singly linked list, determine if it is a palindrome. A palindrome is a string/number that mirrors itself, for example, 21312 reverse is also 21312. We are given …
Given a string that consists of words (non-space characters count as part of a word), you are required to output the new sentence that reverses the words. For example, …
February 18, 2014
algorithms, beginner, brainfuck, c / c++, code, code library, data structure, implementation, programming languages, string
The problem is from LeetCode Online Judge . The puzzle appears to be the most-favourite interview questions. It asks you to implement an algorithm to check if a given …
A Stack is a data structure that satisfies Last-In-First-Out. It can be considered as a pile of plates where you always take the top plate (you put on last). …