![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔试面试
文章平均质量分 54
ASKCOS
AI4Sicence研究员,如有合作请通过站内信。
展开
-
二叉树之深度优先搜索和广度优先搜索 | python
class Node(object): def __init__(self, item): self.elem = item self.lchild = None self.rchild = Noneclass Tree(object): # 每棵树必有一个根节点 def __init__(self): ...原创 2019-07-29 03:16:22 · 72 阅读 · 0 评论 -
桶排序----python
def bucketsort(arr): num_length = len(arr) bucket = [[] for _ in range(num_length)] for data in arr: index = int(data * num_length) bucket[index].append(data) for i ...原创 2019-09-06 20:52:04 · 88 阅读 · 0 评论 -
Java&面经 & 伦敦JP摩根工作实习面试题目
介绍你自己的情况为什么适合这个职位 https://vjudge.net/problem/UVA-10018回文大概题目和这个差不多数字小改 import java.util.Scanner;public class RAA { public static int reverse(int a) { int rs = 0; while (a >...原创 2018-11-26 03:38:30 · 808 阅读 · 0 评论 -
判断一个列表是否存在环 python
class ListNode(): def __init__(self, elem): self.elem = elem self.next = Nonedef hasCycle(List): slow = fast = node1 while fast.next.next and slow.next: slow = s...原创 2019-09-11 15:07:11 · 637 阅读 · 0 评论 -
堆排序 | python
def heap_sort(arr, num_node): bulid_heap(arr, num_node) end = num_node-1 for i in range(end, -1, -1): swap(arr, i ,0) heapify(arr,i, 0)def swap(arr, i , j): temp =arr...原创 2019-09-06 20:54:45 · 77 阅读 · 0 评论 -
子数组最大累加和 python
def FindGreatestSumOfSubArray(arr): if arr is None or len(arr) == 0: return cur = 0 max_num = arr[0] for i in range(len(arr)): cur += list[i] if arr[i] < 0...原创 2019-09-11 13:49:27 · 231 阅读 · 0 评论 -
Leetcode 215. Kth Largest Element in an Array(python 快速排序)
class Solution: def findKthLargest(self, nums: List[int], k: int) -> int: end = len(nums) - 1 self.quick_sort(nums, 0, end) return nums[-k] ...原创 2019-08-24 08:34:43 · 139 阅读 · 0 评论 -
Leetcode 167. Two Sum II - Input array is sorted (python)
class Solution: def twoSum(self, numbers: List[int], target: int) -> List[int]: left = 0 right = len(numbers) - 1 l = len(numbers) while numbers[left] +...原创 2019-08-24 07:26:06 · 63 阅读 · 0 评论 -
华为2019春招留学生笔试第三题python
输入数字转化成对应的excel表值1 -> a 2 -> b3 -> c...26 -> z27 -> aa28 -> ab思路:10进制转换为26进制while True: try: a = int(input()) b = '' while a!=0: a =...原创 2019-03-20 08:41:21 · 964 阅读 · 0 评论 -
华为&python | 2019春招留学生笔试第一题
题目:将输入中的英文字符,大写改成小写,小写改成大写思路一:while True: try: s = input() low = 'abcdefghijklmnopqrstuvwxyz' up = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ns = '' for c in s: ...原创 2019-03-20 06:27:39 · 623 阅读 · 0 评论