## Evaluate Reverse Polish Notation in Javascript

Input: [“3”, “1”, “+”, “5”, “*”] Output: 9 Explanation: ((3 + 1) * 5) = 20 Algorithm: The key thing to realize in this to use stack as a data structure for the solution....

Input: [“3”, “1”, “+”, “5”, “*”] Output: 9 Explanation: ((3 + 1) * 5) = 20 Algorithm: The key thing to realize in this to use stack as a data structure for the solution....

Problem You are given an a string of characters including duplicates. You need to find the first non-repeating / unique character. input: foobar output: f input: aabbccdef output: d input: aabbcc output: ‘No Unique...

Recursive : To delete all the nodes, you will have to visit all the nodes. There are three ways to traverse the binary tree : Post order Pre order In order. To delete all...

Function#bind allows you to create a new function, whose this value will be set to the value you pass. Hence, itÂ allows you to abstract the console.log statements. So, you can type : var...

Problem : Given an array of positive integers find all the duplicate elements. Algorithm : Iterate over the array using forEach Find if there is a duplicate for the element using indexOf indexOf takes...

Problem : Given a JSON data structure with key representing age and value representing the number of people with that age. For example, { 25: 55, 26: 45, 27: 10, 28: 20, 30: 1,...

Problem : Implement a twitter like twit-box component which limits the feed to 140 characters. Logic: If the length of the string is greater than 140 characters If the 141th character is a space...

Problem : The Towers of Hanoi is a classic puzzle with 3 pegs and multiple disks of different sizes. The goal of the puzzle is to move all the disks from the first peg...

Problem : Given a linked list, implement an algorithm which returns the node at the beginning of the loop. This post is a follow-up of – JavaScript Linked List Example – Detect a loop...

Input : A linked list Output: An integer This post is a follow-up of – JavaScript Linked List Example – Detect a loop in cycliccircular linked list. I recommend reading those posts first, as...