duangsuse::Echo
712 subscribers
4.24K photos
127 videos
583 files
6.45K links
import this:
美而不丑、明而不暗、短而不凡、长而不乱,扁平不宽,读而后码,行之天下,勿托地上天国。
异常勿吞,难过勿过,叹一真理。效率是很重要,盲目最是低效。
简明是可靠的先验,不是可靠的祭品。
知其变,守其恒,为天下式;穷其变,知不穷,得地上势。知变守恒却穷变知新,我认真理,我不认真。

技术相干订阅~
另外有 throws 闲杂频道 @dsuset
转载频道 @dsusep
极小可能会有批评zf的消息 如有不适可退出
suse小站(面向运气编程): https://WOJS.org/#/
Download Telegram
This media is not supported in your browser
VIEW IN TELEGRAM
duangsuse::Echo
BubbleSorter.java
实现是(伪代码)

start = start || list.firstIndex
end = end || list.lastIndex

# 减去循环次数是跳过最后一项,最后一项之前对比过,已经是最小的了
for i = start to end
for j = start to end - iteration
if isBiggerThan(list[j + 1], list[j])
swapWithNext(list, j)

最准确的复杂度描述是这样的:

平均情况 O(n ^ 2) 比较 O(n ^ 2) 交换
(但实际上会比这个少,第一个 for 的复杂度是 O(n) 第二的则是 n * 0.5 * n + 1 貌似 )
最坏情况 O(n ^ 2) 比较 O(n ^2) 交换
最佳情况 O(n) 比较 O(1) 交换
空间复杂度 O(1)
This media is not supported in your browser
VIEW IN TELEGRAM
Forwarded from Rachel 碎碎念 (Rachel 空中劈叉的睿智清洁工)
TG 上最近的各种观点越来越较真了,也不知道是环境变了还是人变了
Rachel 碎碎念
TG 上最近的各种观点越来越较真了,也不知道是环境变了还是人变了
人多了,发表的见解能互相看到了,如果碰巧遇到说活比较直白的人的话,讨论起来可能就有点火药味
This media is not supported in your browser
VIEW IN TELEGRAM
给你推荐一个草泥马语言,非常好玩 😆
Forwarded from bystartw 版聊頻道 [ARCHIVED] (21439AnP)
我也曾经写过(实际上是我的第一个不是 Java 也不是 Bash 的程序)一个类似语言的虚拟机,开源在 Coding 和 GitHub 上

https://github.com/duangsuse/MonkeyVM

管它叫猴子虚拟机吧 🐒

:loudspeaker: 58
:loudspeaker: 99
:loudspeaker: 111
:loudspeaker: 100
:loudspeaker: 105
:loudspeaker: 110
:loudspeaker: 103
:loudspeaker: 58
:loudspeaker: 72
:loudspeaker: 97
:loudspeaker: 112
:loudspeaker: 112
:loudspeaker: 121
:loudspeaker: 32
:loudspeaker: 78
:loudspeaker: 101
:loudspeaker: 119
:loudspeaker: 32
:loudspeaker: 89
:loudspeaker: 101
:loudspeaker: 97
:loudspeaker: 114
duangsuse::Echo
monkey_vm.js
别误会了,这是用 Rust 写的,编译成了 WebAssembly ASM.js 的形式
This media is not supported in your browser
VIEW IN TELEGRAM
Forwarded from dnaugsuz
Forwarded from dnaugsuz
Forwarded from dnaugsuz
最近正在写一个 Rebase API 服务器,类似上次的 Times,不过这次是 Crytal 写的,而且是更复杂的 Rebase API 服务
This media is not supported in your browser
VIEW IN TELEGRAM