自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(164)
  • 资源 (11)
  • 收藏
  • 关注

原创 MIT6.824-Lab1

一、介绍 通过阅读MapReduce论文,在本地实现一个分布式MapReduce。课程提供的代码中需要修改的有三处(mr/coordinator.go, mr/worker.go, mr/rpc.go),其中coordinator.go就是论文中的master角色,rpc.go中定义rpc通信需要的一些结构。 二、实现流程 coordinator根据用户传进来的inputs(pg-*.txt)生成Nmap个Map任务。(我是一个文件生成一个Map任务,也可自行定义,作业未对Map个数作硬性规定) w

2021-03-17 15:52:25 1402 1

原创 143. Reorder List

Given a singly linked listL:L0→L1→…→Ln-1→Ln, reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→… You maynotmodify the values in the list's nodes, only nodes itself may be changed. Example 1: Given 1->2-...

2019-07-22 23:15:47 178

原创 142. Linked List Cycle II

Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull. To represent a cycle in the given linked list, we use an integerposwhich represents the position (0-i...

2019-07-22 21:36:47 167

原创 141. Linked List Cycle

Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integerposwhich represents the position (0-indexed)in the linked list where tail co...

2019-07-22 20:58:39 158

原创 140. Word Break II

Given anon-emptystringsand a dictionarywordDictcontaining a list ofnon-emptywords, add spaces insto construct a sentence where each word is a valid dictionary word.Return all such possible s...

2019-07-22 20:05:00 104

原创 139. Word Break

Given anon-emptystringsand a dictionarywordDictcontaining a list ofnon-emptywords, determine ifscan be segmented into a space-separated sequence of one or more dictionary words. Note: The s...

2019-07-21 23:00:28 121

原创 138. Copy List with Random Pointer

A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return adeep copyof the list. Example 1: Input: {"$id":"1...

2019-07-21 21:24:48 118

原创 136. Single Number

Given anon-emptyarray of integers, every element appearstwiceexcept for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without us...

2019-07-12 21:55:13 99

原创 135. Candy

There areNchildren standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following requirements: Each child must have at least one ca...

2019-07-12 21:11:11 107

原创 134. Gas Station

There areNgas stations along a circular route, where the amount of gas at stationiisgas[i]. You have a car with an unlimited gas tank and it costscost[i]of gas to travel from stationito its ...

2019-07-11 22:21:46 79

原创 133. Clone Graph

Givena reference of a node in aconnectedundirected graph, return adeep copy(clone) of the graph. Each node in the graph contains a val (int) and a list (List[Node]) of its neighbors. Example:...

2019-07-11 21:34:11 147

转载 132. Palindrome Partitioning II

Given a strings, partitionssuch that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning ofs. Example: Input:"aab" Output: 1 Explana...

2019-07-11 20:34:50 103

转载 131. Palindrome Partitioning

Given a strings, partitionssuch that every substring of the partition is a palindrome. Return all possible palindrome partitioning ofs. Example: Input:"aab" Output: [ ["aa","b"], ["a","a"...

2019-07-11 16:24:05 121

原创 130. Surrounded Regions

Given a 2D board containing'X'and'O'(the letter O), capture all regions surrounded by'X'. A region is captured by flipping all'O's into'X's in that surrounded region. Example: X X X X X O O...

2019-07-05 15:12:50 88

原创 129. Sum Root to Leaf Numbers

Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number. An example is the root-to-leaf path1->2->3which represents the number123. Find the tota...

2019-07-05 14:35:12 119

原创 128. Longest Consecutive Sequence

Given an unsorted array of integers, find the length of the longest consecutive elements sequence. Your algorithm should run in O(n) complexity. Example: Input:[100, 4, 200, 1, 3, 2] Output: 4 Ex...

2019-07-05 11:49:55 104

转载 127. Word Ladder

Given two words (beginWordandendWord), and a dictionary's word list, find the length of shortest transformation sequence frombeginWordtoendWord, such that: Only one letter can be changed at a ti...

2019-07-05 10:14:21 107

原创 125. Valid Palindrome

Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note:For the purpose of this problem, we define empty string as valid palindrome. Examp...

2019-07-04 16:45:56 113

原创 124. Binary Tree Maximum Path Sum

Given anon-emptybinary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connectio...

2019-07-04 16:30:17 108

原创 123. Best Time to Buy and Sell Stock III

Say you have an array for which theithelement is the price of a given stock on dayi. Design an algorithm to find the maximum profit. You may complete at mosttwotransactions. Note:You may not en...

2019-07-04 15:35:28 115

原创 122. Best Time to Buy and Sell Stock II

Say you have an array for which theithelement is the price of a given stock on dayi. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., buy on...

2019-07-04 14:21:55 91

原创 121. Best Time to Buy and Sell Stock

Say you have an array for which theithelement is the price of a given stock on dayi. If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock),...

2019-07-04 13:54:08 118

原创 117. Populating Next Right Pointers in Each Node II

Given a binary tree struct Node { int val; Node *left; Node *right; Node *next; } Populate each next pointer to point to its next right node. If there is no next right node, the next point...

2019-07-04 13:41:44 103

原创 120. Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ [2], [3,4], [6,5...

2019-06-27 21:26:57 72

原创 119. Pascal's Triangle II

Given a non-negativeindexkwherek≤33, return thekthindex row of the Pascal's triangle. Note that the row index starts from0. In Pascal's triangle, each number is the sum of the two numbers ...

2019-06-27 20:11:20 101

原创 118. Pascal's Triangle

Given a non-negative integernumRows, generate the firstnumRowsof Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it. Example: Input: 5 Output: [...

2019-06-27 20:02:27 87

原创 116. Populating Next Right Pointers in Each Node

You are given aperfect binary treewhereall leaves are on the same level, and every parent has two children. The binary tree has the following definition: struct Node { int val; Node *left; ...

2019-06-27 19:44:25 102

原创 115. Distinct Subsequences

Given a stringSand a stringT, count the number of distinct subsequences ofSwhich equalsT. A subsequence of a string is a new string which is formed from the original string by deleting some (ca...

2019-06-27 19:08:47 112

原创 114. Flatten Binary Tree to Linked List

Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look like: 1 \ 2 \ ...

2019-06-27 16:02:27 70

原创 113. Path Sum II

Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. Note:A leaf is a node with no children. Example: Given the below binary tree andsum = 22, ...

2019-06-27 15:34:41 74

原创 112. Path Sum

Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. Note:A leaf is a node with no children. Example:...

2019-06-27 14:53:36 82

原创 111. Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. Note:A leaf is a node with no childre...

2019-06-27 14:39:09 72

原创 110. Balanced Binary Tree

Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the depth of the two subtrees ofeverynode never diff...

2019-06-23 00:04:35 71

原创 109. Convert Sorted List to Binary Search Tree

Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is defined as a binary tree in which the ...

2019-06-22 23:28:52 77

原创 108. Convert Sorted Array to Binary Search Tree

Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the...

2019-06-22 23:23:08 91

原创 107. Binary Tree Level Order Traversal II

Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree[3,9,20,null,null,15,7...

2019-06-22 22:52:19 97

原创 106. Construct Binary Tree from Inorder and Postorder Traversal

Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. For example, given inorder =[9,3,15,20,7] postorder = [9...

2019-06-22 22:17:59 99

原创 1007 Maximum Subsequence Sum(25 分)

Given a sequence of K integers { N​1​​, N​2​​, ..., N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​i+1​​, ..., N​j​​ } where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequen...

2018-08-28 22:55:19 211

原创 问题 C: 畅通工程

题目描述 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 输入 测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M (N, M < =100 );随后的 N 行对应村庄...

2018-08-26 23:37:34 452

原创 问题 A: 还是畅通工程

题目描述         某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 输入         测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( < 100 );随后的N(N-1)...

2018-08-26 23:32:18 350

Coursea平台-普林斯顿大学-Algorithms-II-第四周-Boggle编程作业

闲来无事观看了coursea学习平台上的Princeton University开设的Algorithms-II课程,自主完成了第四周编程作业,Boggle,dictionary存储结构使用了ternary search tries数据结构。写完提交第一次有了96分,有两个timing点未过,感觉不大好改,就没改了,96分也不赖了,自我安慰!!!成绩:96score.

2020-02-28

Coursea平台-普林斯顿大学-Algorithms-II-第三周-Baseball Elimination编程作业

闲来无事观看了coursea学习平台上的Princeton University开设的Algorithms-II课程,自主完成了第三周编程作业,Baseball Elimination,成绩:100 score.

2020-02-25

Coursea平台-普林斯顿大学-Algorithms-II-第二周-SeamCarver编程作业

闲来无事观看了coursea学习平台上的Princeton University开设的Algorithms-II课程,自主完成了第二周编程作业,SeamCarver,成绩:100 score.

2020-02-22

Coursea平台-普林斯顿大学-Algorithms-I-第五周-Kd-Trees编程作业-满分

博主闲来无事观看了coursea学习平台上的Princeton University开设的Algorithms-I课程,自主完成了第五周编程作业,Kd-Trees,成绩:0 errors 0 warnings 100 score.

2020-02-13

魔兽世界三(开战)-北京大学-C++程序设计与算法

该资源是中国大学MOOC网站上北京大学开设的《C++程序设计与算法-3》的最终大作业,博主在倍速看完后,使用QT完全由自己编写而成。由于考虑到程序的整体架构清晰明白,分了好几个类文件,后来看了网上其他同学的代码,才发现都是写成了一个文件。不过我也懒得改了,代码测试:网站上给的测试点测试通过,自己也随机设计了几个测试点,没有发现

2020-02-11

利用OpenCV2.1制作个人视频(加个人图片、字幕、暂停)

在win10系统上使用visual studio 2019中C++编写而成,安装OpenCV2.1。 功能: 1、视频回放:不断读取摄像头视频并回放,在回放的视频上,额外添加了以下内容:本人大头贴、姓名、学号、当前时间。 2、键盘读取:按空格键开始录制视频,再按空格键暂停录制(视频中间出现暂停标志),按ESC键退出程序。 3、鼠标读取:按住鼠标左键,可以在视频中画任意线条。

2019-11-24

Tcp通信(基于QT5.13 + TCP + 服务端 + 客户端)

该资源基于QT5.13.0编写而成,简单利用TCP进行通信,包括一个服务端与客户端,多个客户端和一个服务端可正常通信,且加了回车发送消息,发布版本已生成(在publication中)。

2019-07-06

视频播放器(基于Qt5.13.0 + mplayer + win10)

该资源基于QT5.13.0版本编写而成,该视频播放器功能简介:添加视频(可多选视频,依次播放),拖拉视频(一次仅限拖拉一个视频),拖拉进度条,上一视频,下一视频,暂停,音量调节,双击屏幕全屏,按键(esc)全屏切换。该资源包含QT项目文档,mplayer资源,下载解压后发布可执行程序(在publication中“视频播放器.exe”)可直接执行。

2019-07-03

简易记事本小程序

该程序基于Qt5.13.0编写而成,使用c++。实现了文本文档的几个基本操作,菜单栏包括文件、编辑、窗口、帮助等功能。该资源内含完整QT项目文件以及已封包的可执行文件(在publication的“简易记事本.exe”),适合初学者学习使用。

2019-07-01

黑白棋小程序

基于QT编写的黑白棋小程序,拥有主界面,人对人游戏界面,人机游戏界面,游戏规则界面。资源包括程序发布文件,QT项目文档。

2019-06-27

重复文件查询.exe

选择目标文件夹,小程序对其内的文件和子文件夹进行搜索,查询出重复文件,列出重复文件的文件路径名,自行决定后续操作。 属于本人QT练手小程序。

2019-06-19

空空如也

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

TA关注的人

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