自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 收藏
  • 关注

原创 期末项目:Capacitated Facility Location Problem

题目 代码 import random import math import datetime import os import time INSTANCE_NUMBER = 71 LOOP_LENGTH = 1000 MAX_TEMPERATURE = 100 MIN_TEMPERATURE = 0.5 ATTENUATION_QUOTIENT = 0.9 MAX_NUM = 10000...

2018-12-31 00:09:03 362

原创 LeetCode 算法学习(14)

题目描述 Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Determine i...

2018-12-29 14:31:43 214

原创 LeetCode 算法学习(13)

题目描述 Given a binary tree, return the inorder traversal of its nodes’ values. 题目大意 对二叉树进行中序遍历。 思路分析 这里我使用非递归的写法,关键在于处理好入栈时机和出栈时机。当栈顶元素没有左子树时出栈,p转向其右子树继续遍历。 关键代码 vector<int> inorderTraversal...

2018-12-29 13:59:54 238 1

原创 LeeCode 算法学习(12)

题目描述 Validate Binary Search Tree Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys...

2018-12-27 20:06:16 284

原创 LeetCode 算法学习(11)

题目描述 Construct Binary Tree from Preorder and Inorder Traversal Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree...

2018-12-27 18:58:36 269

原创 LeetCode算法学习(10)

题目描述 Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head. Example: Given 1->2->3->4, you should return the list as 2->1->4->3. Note: Your al...

2018-12-26 23:58:39 226

原创 LeetCode算法学习(9)

题目描述 Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: Input: 1->2->...

2018-12-26 23:22:30 148

原创 LeetCode算法学习(8)

题目描述 Valid Parentheses Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. An input string is valid if: 1.Open brackets must be clos...

2018-12-26 22:57:00 188

原创 LeetCode 算法学习(7)

题目描述 Remove Nth Node From End of List Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list: 1->2->3->4->5, and n = 2. After remo...

2018-12-26 22:36:15 216

原创 LeetCode 算法学习(6)

题目描述 Container With Most Water Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is a...

2018-12-26 21:19:20 153

原创 LeetCode 算法学习(5)

题目描述 String to Integer (atoi) Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-whitespace character is ...

2018-12-26 18:32:01 171

原创 LeetCode 算法学习(4)

題目描述 Reverse Integer Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Note: Assume we are dealing with an environment which could only store integers w...

2018-12-26 17:56:13 186

原创 LeetCode 算法学习(3)

算法描述 Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m...

2018-12-26 16:09:58 128

原创 LeetCode 算法学习(2)

题目描述 Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. Example 1: Input: “abcabcbb” Output: 3 Explanation: The ans...

2018-12-25 22:05:46 230

原创 LeetCode 算法学习(1)

题目描述 Add Two Numbers You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the tw...

2018-12-25 17:06:34 206

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除