- 博客(6)
- 资源 (3)
- 收藏
- 关注
原创 pta 6-11 求自定类型元素序列的中位数
问题描述本题要求实现一个函数,求N个集合元素A[]的中位数,即序列中第⌊N/2+1⌋大的元素。其中集合元素的类型为自定义的ElementType。其中给定集合元素存放在数组A[]中,正整数N是数组元素个数。该函数须返回N个A[]元素的中位数,其值也必须是ElementType类型。分析//先排序,再找第中间大的数。 //还有就是找到数组中第k大的数,一个叫做快速选择算法,
2018-01-24 10:37:18 4876 5
原创 pta 6-10 阶乘计算升级版
问题描述本题要求实现一个打印非负整数阶乘的函数。其中N是用户传入的参数,其值不超过1000。 如果N是非负整数,则该函数必须在一行中打印出N!的值,否则打印“Invalid input”分析这个题不能用int存结果。15就已经溢出了。用数组存数。代码#include void Print_Factorial ( const int N ){ i
2018-01-24 10:22:51 1774
原创 LeetCode problem 4. 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+n)). 找中间数字。例子
2018-01-16 18:53:23 190
原创 LeetCode problem 3. Longest Substring Without Repeating Characters
问题描述Given a string, find the length of the longest substring without repeating characters. (找出最长的没有重复字母出现的子串。输出其最长长度。)例子Given “abcabcbb”, the answer is “abc”, which the length is 3.
2018-01-16 18:39:20 179
原创 LeetCode problem 2. 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 two numbers and re
2018-01-16 18:21:27 284
原创 LeeCode problem 1. Two Sum
Description Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and
2018-01-16 18:08:59 208
kaggle-dataset sentiment-analysis-on-movie-reviews
2020-08-05
etc目录详解
2017-01-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人