
算法oj编程题
Phoebe-Gao
国防科大在读博士二年级4th Semester
Email:gaofei@nudt.edu.cn
欢迎联系交流讨论
展开
-
寻找二叉树的最小深度
【Day 1】英文题目: Given a binary tree, find its mininum. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.中文题目: 寻找一棵二叉树的最小深度。最小深度是指从根结点到最...原创 2019-02-03 20:25:50 · 391 阅读 · 0 评论 -
用反波兰符号计算算术表达式的值
【Day2】英文题目: Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are+,-,,/. Each operand may be aninteger or another expression. Some examples: [“2”, “1”, “+”...原创 2019-02-04 20:44:28 · 554 阅读 · 0 评论 -
成绩排序
【T4】题目(from 清华大学): 输入任意(用户,成绩)序列,可以获得成绩从高到低或从低到高的排列,相同成绩都按先录入排列在前的规则处理。输入描述:输入多行,先输入要排序的人的个数,然后输入排序方法0(降序)或者1(升序)再分别输入他们的名字和成绩,以一个空格隔开。输出描述:按照指定方式输出名字和成绩,名字和成绩之间以一个空格隔开。示例1输入:30fang ...原创 2019-02-24 20:49:19 · 296 阅读 · 0 评论 -
输入n个整数,依次输出每个数的约数的个数
【T5】上次排序算法自己写了冒泡,大水哥推荐了sort()函数,妙呀hh,借一篇博客学习了一下https://blog.youkuaiyun.com/w_linux/article/details/76222112题目描述:输入n个整数,依次输出每个数的约数的个数输入描述:输入的第一行为N,即数组的个数(N<=1000)接下来的1行包括N个整数,其中每个数的范围为(1<=Num<...原创 2019-02-26 11:10:14 · 4317 阅读 · 3 评论 -
在一个给定的n个点的平面,找到在某条直线上的最多的点的数量。
【T3】英文题目:Given n points on a 2D plane, find the maximum number of pointsthat lie on the same straight line.中文题目:在一个给定的n个点的平面,找到在某条直线上的最多的点的数量。大致思路:给了你一系列点,这会产生很多条直线,如何确定哪些直线上的点的数量听起来就令人头晕,但简化问题...原创 2019-02-21 11:11:18 · 1354 阅读 · 0 评论 -
PAT-L2-002 链表去重 (25 分)
L2-002 链表去重 (25 分)题目:给定一个带整数键值的链表 L,你需要把其中绝对值重复的键值结点删掉。即对每个键值 K,只有第一个绝对值等于 K的结点被保留。同时,所有被删除的结点须被保存在另一个链表上。例如给定 L 为 21→-15→-15→-7→15,你需要输出去重后的链表21→-15→-7,还有被删除的链表 -15→15。输入格式:输入在第一行给出 L 的第一个结点的地...原创 2019-05-22 14:21:13 · 405 阅读 · 0 评论 -
1025 PAT Ranking (25 分)
Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the ranklists ...原创 2019-06-22 10:50:04 · 109 阅读 · 0 评论