Tags » Geeky » Page 2

Implement Queue using Stacks

Idea: Java has its own Stack class, extending from Vector. Methods are push, pop, peek, empty, search.

When pushing the elements from stack 1 to stack 2, the pop & push operation combination rightly fits the correct sequence of joining elements from two stacks.


These Star Wars Group Costumes Are Awesome

Liz Stanley at Say Yes shared a Star Wars style, easy-on-the-wallet (and nerves) approach to Halloween costumes:

Perfect for Halloween: evocatives outfits that are easy to create almost entirely by using everyday items. 53 more words


Remove Duplicates from Sorted List

Idea 1: Iteration

Set a new pointer node, keep the original head as leading out the whole list

Idea 2: Recursion

Delete the repeated node for the first node, and use recursion repeatedly apple the deleting to all other following nodes.