LeetCode,leetcodeoj題目連結:Remove Duplicates from Sorted ListGiven a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.
最小產生樹,產生樹最小產生樹 一個有 n 個結點的連通圖的最小產生樹是原圖的極小連通子圖,且包含原圖中的所有 n 個結點,並且有保持圖連通的權值總和最小的邊。劉汝佳<<訓練指南>>P343詳細介紹了最小產生樹相關的知識。 下面直接給出Kruskal演算法的模板:<span style="font-size:18px;">
Python入門——石頭剪刀布程式,python入門石頭剪刀概述:如果你和我一樣是一個有著其他語言基礎的編程者,那我想這個小程式對於你來說是小case。由於本人初學Python,就先拿這個熟悉熟悉一下文法,就不再是以前大家都愛用的Hello World了。流程圖:代碼如下:import random# define a function for get winner# 1: Scissor# 2: Stone# 3: Clothdef get_winner(you, me): if
NSDictionary,NSArray轉成NSData(JSON)NSString類型,nsdatansstring//// NSDictionary+JSONorNSString.h// UIKit資料轉換//// Created by mac on 15-4-4.// Copyright (c) 2015年 www.swift.com. All rights reserved.//#import <Foundation/Foundation.h>@interface
LeetCode,leetcodeoj題目連結:Largest Rectangle in HistogramGiven n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram. 6 5 □ □ □ □ □ 32 □ □
POJ3294---Life Forms(尾碼數組,二分+給尾碼分組),尾碼數組 DescriptionYou may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, ears, eyebrows and the like. A few bear no human