查看: 1636| 回复: 22
跳转到指定楼层
上一主题 下一主题
收起左侧

刷题打卡记录

全局:

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
如题,
希望能在明年六月前刷完400道题。 每天都会更新进度和总结。

上一篇:金融学生强行转码实录 女人也要顶起半边天
下一篇:找同學一起開zoom刷題,寫代碼
推荐
 楼主| Liumiuniuniuniu 2024-2-21 12:07:40 来自APP | 只看该作者
全局:
wanyong8 发表于 2024-02-20 16:03:28
多谢多谢!是会和hr确定具体的start date。也是想请教一下具体uscis是怎么知道、verify这个date的。 所以uscis 是通过Payroll
这个是这样的,举个极端的例子,假如我现在给雇主a工作,然后联系了雇主b跳槽让他帮忙办h1b transfer,雇主b给我办好了,但是我反悔不想去了,完全没有从雇主a辞职继续干下去,是完全合法的。雇主b帮我file的h1b申请因为我从来没有入职,所以从来没有真的生效过。
同样关于你的问题,uscis只会关注新东家帮你file的h1b申请是不是合理,他不需要去verify这个start date是不是真实的start date,因为甚至这个申请可能从来不会被激活就像我上面的例子。因为你真实的start date要满足两个条件1,为新雇主工作 2,这个日期晚于你h1b transfering上面的start date。 条件1什么时候开始工作是你的新单位决定的,这个日期必须跟payroll记录和之后的employment verification letter上面的日期一致。
所以关于你的问题 在新单位file h1b的时候 你可以让他们随便填一个比较近的日期,在那个日期你可以继续为老单位工作也没问题。你只需要保证你的实际开始工作时间晚于h1b application上写的那个时间就可以了。
回复

使用道具 举报

推荐
 楼主| Liumiuniuniuniu 2020-12-27 05:22:31 | 只看该作者
全局:
day 1 - 12/26/2020

bubble sort
参考了 https://stackabuse.com/bubble-sort-in-python/

Bubble Sort is one of the worst-performing sorting algorithms in every case except checking whether the array is already sorted, where it often outperforms more efficient sorting algorithms like Quick Sort.
In the most inefficient approach, Bubble Sort goes through n-1 iterations, looking at n-1 pairs of adjacent elements. This gives it the time complexity of O(n2), in both best-case and average-case situations. O(n2) is considered pretty horrible for a sorting algorithm.
It does have an O(1) space complexity, but that isn't enough to compensate for its shortcomings in other fields.

最简单的达到 O(n^2) 的implementation:
  1. def bubbleSort(array):
  2.     for i in range(len(array) - 1):
  3.                 for j in range(0, len(array) - 1):
  4.                         if array[j + 1] < array[j]:
  5.                                 array[j + 1], array[j] = array[j], array[j + 1]
  6.         return array
复制代码

注意到 在任意一次iteration内, 假如 当j > swapEnd时, 所有的j,j+1都不需要交换, 则swapEnd之后都是有序排列的, 但是swapEnd之前的数组还可能是乱序。
例如 5, 2, 1, 6, 7
一次iteration之后变成 2,1,5, 6, 7. 这里swapEnd 的index是 1.

经过optimization 的版本, optimize了 loop i 的终止条件 和 loop j的终止条件
  1. def bubbleSort(array):
  2.         hasSwapped = True
  3.     swapEnd = len(array) - 1
  4.         while(hasSwapped):
  5.                 hasSwapped = False
  6.                 for j in range(swapEnd):
  7.                         if array[j] > array[j + 1]:
  8.                                 array[j], array[j + 1] = array[j + 1], array[j]
  9.                                 hasSwapped = True
  10.                                 swapEnd = j
  11.         return array
复制代码
回复

使用道具 举报

推荐
 楼主| Liumiuniuniuniu 2020-12-27 05:39:14 | 只看该作者
全局:
本帖最后由 Liumiuniuniuniu 于 2020-12-27 05:42 编辑

day 1 - 12/26/2020
selection sorting

Time Complexity: O(n^2) in best/average/worst scenarios as there are two nested loops.
Auxiliary Space: O(1)
The good thing about selection sort is it never makes more than O(n) swaps and can be useful when memory write is a costly operation.

this sorting method is not stable.
  1. def selectionSort(array):
  2.     for i in range(len(array)):
  3.                 minIdx = i
  4.                 for j in range(i + 1, len(array)):                        
  5.                         if array[j] < array[minIdx]:
  6.                                 minIdx = j
  7.                 if minIdx != i:
  8.                         array[i], array[minIdx] = array[minIdx], array[i]
  9.         return array
复制代码

[/i][/i]
回复

使用道具 举报

🔗
 楼主| Liumiuniuniuniu 2020-12-27 10:12:09 | 只看该作者
全局:
day 1 - 12/26/2020
insertion sort

insertion sort is stable
best time complexity O(n), space complexity O(1)
average time complexity O(n^2), space complexity O(1)
worst time complexity O(n^2), space complexity O(1)

  1. def insertionSort(array):
  2.     for i in range(1, len(array)):
  3.                 current = array[i]
  4.                 j = i - 1
  5.                 while j >= 0 and array[j] > current:
  6.                         array[j + 1] = array[j]
  7.                         j -= 1
  8.                 array[j + 1] = current
  9.         return array
复制代码
回复

使用道具 举报

🔗
 楼主| Liumiuniuniuniu 2020-12-27 14:40:34 | 只看该作者
全局:
day1 - 12/26/2020

sorting
bubble sort
insertion sort
selection sort
three number sort
quick sort
heap sort
marge sort

pending item:
implementation of heap
回复

使用道具 举报

🔗
 楼主| Liumiuniuniuniu 2020-12-28 10:41:18 | 只看该作者
全局:
本帖最后由 Liumiuniuniuniu 于 2020-12-28 11:27 编辑

day2 - 12/27/2020

今日主题 stack
刷题有:
Find the n largest number
Sunset Views
Min Max stack construction
Balanced Brackets
Shorten path  注意 tokens = str.split()    "/".join(my_list)

顺便刷的简单题:two sum number
validate subsequence
binary search
palindrome check
caesar cipher encryptor 注意 chr 和 ord function的用法
run-length encoding


pending items:comparison of sorting algorithm
implementation of heap
implementation of stack and queue, (python 中list的api)
python中string的api


回复

使用道具 举报

🔗
 楼主| Liumiuniuniuniu 2020-12-29 13:57:48 | 只看该作者
全局:
本帖最后由 Liumiuniuniuniu 于 2020-12-29 14:20 编辑

day3 - 12/28/2020
刷题
branch sum  分治 和 递归
Find Closest in BST  递归 和  遍历
Node Depths 递归 和 BST
product sum 注意 type(item) is list 的用法

pending items:
comparisonofsortingalgorithm
implementationofheap
implementationofstackandqueue(python中list的api)
python中string的api



回复

使用道具 举报

🔗
 楼主| Liumiuniuniuniu 2020-12-30 12:47:52 | 只看该作者
全局:
本帖最后由 Liumiuniuniuniu 于 2020-12-30 12:49 编辑

day 3 - 12/29/2020

今日刷题
nth Fibonacci 注意这道题可以用decorator来做memoize
depth first search
Three number sum 加强版的two sum
smallest difference
move element to end
monotonic array
array of products
first duplicate value 注意把 number 当idx的用法basic calculator 这道题有点难 肯定要重刷的

pending item
还是那些 哎 没啥心情做 希望周末可以做完

今天把naive的都清掉了 希望可以早日把easy清掉 坚持哇

回复

使用道具 举报

🔗
 楼主| Liumiuniuniuniu 2021-1-4 13:08:22 | 只看该作者
全局:
day5 - 1/4/2021

没想到一晃过去了那么多天。。。 目前只坚持了leetcode的每日一题。没有再额外刷题了 要加强时间管理啊
回复

使用道具 举报

🔗
 楼主| Liumiuniuniuniu 2021-1-6 13:37:17 | 只看该作者
全局:
DAY6 - 1/6/2020

做了每日一题 每天效率好低 明天加油哇
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表