Given a linked list, swap every two adjacent nodes and return its head.For example, Given 1->2->3->4, you should return the list as 2->1->4->3.Your al... Read More
posted @ 2014-07-14 23:48 Xylophone Views(102) Comments(0) Diggs(0)
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, ... Read More
posted @ 2014-07-14 23:08 Xylophone Views(128) Comments(0) Diggs(0)
Given two binary strings, return their sum (also a binary string).For example, a = "11" b = "1" Return "100".class Solution {public: string addBina... Read More
posted @ 2014-07-14 21:57 Xylophone Views(137) Comments(0) Diggs(0)
Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For ... Read More
posted @ 2014-07-14 15:49 Xylophone Views(194) Comments(0) Diggs(0)