智取+硬功夫 Read More
posted @ 2016-04-21 19:08 zhaodonglin Views(92) Comments(0) Diggs(0)
import unittest# A B1 B2 C1 C2 C3 C4 D1 D2 D3 Egraph=[ [0, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 6, 3, 0, 0, 0, 0, 0], [0, 0, 0, 0, 8, 0, 4, 0, Read More
posted @ 2016-04-21 19:04 zhaodonglin Views(163) Comments(0) Diggs(0)
import unittest class tree: left_node = None right_node = None value = 0 string = None def __init__(self, left_node, right_node, _val, _str): self.lef Read More
posted @ 2016-04-21 08:05 zhaodonglin Views(156) Comments(0) Diggs(0)
from functools import reducedef swap(a, i, j): t = a[i] a[i]=a[j] a[j]=t def heapify_sub_tree1(a,i,size): minimum = i j = 2*i if (j<=size and a[j] < a Read More
posted @ 2016-04-17 15:30 zhaodonglin Views(108) Comments(0) Diggs(0)
import unittesttitle=0def fill_chess_board(chess_board, chess_board_row,chess_board_column, filled_block_row, filled_block_column, size): global title Read More
posted @ 2016-04-03 17:20 zhaodonglin Views(163) Comments(0) Diggs(0)
#find the nearest point in two dimensions#1 first if there are only two points, then calculate the distance directly#2 if there are three points, get Read More
posted @ 2016-04-03 16:02 zhaodonglin Views(164) Comments(0) Diggs(0)
import unittest def merge(list1, list2, list1_begin, list1_end, list2_begin, list2_end): list3 = [] i = list1_begin j = list2_begin while (i<list1_end Read More
posted @ 2016-04-02 15:59 zhaodonglin Views(130) Comments(0) Diggs(0)
#include <iostream>using namespace std; void swap(int array[], int beginPos, int endPos){ int t = array[beginPos]; array[beginPos] = array[endPos]; ar Read More
posted @ 2016-03-28 08:19 zhaodonglin Views(142) Comments(0) Diggs(0)
#include<iostream>using namespace std; void DoMerge(int array[], int buff[], int begin, int middle, int end){ int leftHalfBegin = begin; int leftHalfE Read More
posted @ 2016-03-19 16:47 zhaodonglin Views(125) Comments(0) Diggs(0)
#include<iostream>using namespace std; int copyTimes(int playerNumber){ int i =0; while(playerNumber != 1){ playerNumber = playerNumber/2; i++; } retu Read More
posted @ 2016-03-19 16:46 zhaodonglin Views(102) Comments(0) Diggs(0)