Nick

亘古而常青的昨天永远是过去,也永远会再来。

215. Kth Largest Element in an Array(数组中第k大的数字)

Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For exa...

2017-08-27 22:54:49

阅读数:92

评论数:0

三种快速排序算法的实现(递归算法、非递归算法、三路划分快速排序)

转载 http://blog.csdn.net/yunzhongguwu005/article/details/9455991

2017-08-27 22:51:38

阅读数:112

评论数:0

拼多多2018校招内推编程题汇总

[编程题] 最大乘积时间限制:1秒 空间限制:32768K给定一个无序数组,包含正数、负数和0,要求从中找出3个数的乘积,使得乘积最大,要求时间复杂度:O(n),空间复杂度:O(1) 输入描述: 无序整数数组A[n]输出描述: 满足条件的最大乘积输入例子1: 3 4 1 2输出例子1: ...

2017-08-13 21:56:16

阅读数:446

评论数:0

遍历二叉树

一、前序遍历 前序遍历简单来讲,遍历顺序是:根节点-左子树-右子树 1、递归遍历 1 void preorder(BinTree *T) 2 { 3 if(T==NULL) 4 return; 5 cout << T->data; 6 pr...

2017-08-12 14:19:41

阅读数:149

评论数:0

207 Course Schedule (课程清单)

There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have t...

2017-08-11 11:46:49

阅读数:110

评论数:0

206 Reverse Linked List

Reverse a singly linked list.程序如下:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNo...

2017-08-10 10:17:34

阅读数:94

评论数:0

多标签图像分类任务的评价方法-mAP

多标签图像分类(Multi-label   Image  Classification)任务中图片的标签不止一个,因此评价不能用普通单标签图像分类的标准,即mean  accuracy,该任务采用的是和信息检索中类似的方法—mAP(mean  Average  Precision)。mAP虽然字面...

2017-08-09 21:27:21

阅读数:248

评论数:0

200 Number of Islands(岛屿数量)

Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjace...

2017-08-09 10:45:10

阅读数:119

评论数:0

198/213/337 House Robber

198 House Robber You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only con...

2017-08-08 11:21:07

阅读数:147

评论数:0

169/229 Majority Element(寻找众数)

169 Majority Element Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ ...

2017-08-07 18:09:51

阅读数:147

评论数:0

160 Intersection of Two Linked Lists 求两个链表的交点

Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: ...

2017-08-05 12:17:59

阅读数:219

评论数:0

53/152 Maximum Product Subarray /Maximum Subarray(子序列之 和/积 最大)

53 Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1...

2017-08-04 10:30:52

阅读数:96

评论数:0

148 Sort List (归并实现链表排序)

Sort a linked list in O(n log n) time using constant space complexity. 常见排序方法有很多,插入排序,选择排序,堆排序,快速排序,冒泡排序,归并排序,桶排序等等。。它们的时间复杂度不尽相同,而这里题目限定了时间必须为O(nlg...

2017-08-03 10:29:20

阅读数:214

评论数:0

106/107/108 Convert * to Binary Search Tree 组转为二叉搜索树

108 Convert Sorted Array to Binary Search Tree 将有序数组转为二叉搜索树Given an array where elements are sorted in ascending order, convert it to a height balanc...

2017-08-02 10:32:26

阅读数:258

评论数:0

136/137/260 Single Number

136 Single Number Given an array of integers, every element appears twice except for one. Find that single one.Note: Your algorithm should have a ...

2017-08-01 17:50:15

阅读数:141

评论数:0

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