Tag: iterative
Question : Given a sorted list represented by a directional link structure (as follows), remove the duplicates and return the new list. /** * Definition for singly-linked list. * …
Question: Given an unsorted list of integers, find out the first missing positive. Problem Description: http://oj.leetcode.com/problems/first-missing-positive/ Examples: should return 3; should return 2. Can you do it with O(n) …
The problem is from codeforces: http://codeforces.com/problemset/problem/347/B It has been a while and I just pick another easy math problem to update the blog. The problem states that only maximum 1 …
Some complex tasks might not be so complicated. For example, to emulate the matrix printing like the following. All you need is just a few lines of code in …
Fermat Prime Test Algorithm is to check whether a number is prime. It is a probabilistic approach that based on the following observation. . This is also known as …