Refine kotlin code (#1241)

* style(kotlin): Improve kotlin codes readability.

* remove redundant quotes.

* style(kotlin): improve codes readability.

* style(kotlin): refine kotlin codes.

* Create kotlin.yml

* Create kotlin.yml

* Delete .github/workflows/kotlin

* Delete .github/workflows/main.yml

* Create kotlin.yml

* Update kotlin.yml

* Delete .github/workflows/kotlin.yml

* Create hello_world_workflow.main.kts

* Delete .github/workflows/hello_world_workflow.main.kts

* remove empty line
This commit is contained in:
curtishd
2024-04-09 16:26:58 +08:00
committed by GitHub
parent 41dd677338
commit 896d9a64f6
22 changed files with 158 additions and 112 deletions

View File

@@ -7,10 +7,11 @@
package chapter_stack_and_queue
/* 基于环形数组实现的双向队列 */
/* 构造方法 */
class ArrayDeque(capacity: Int) {
private var nums = IntArray(capacity) // 用于存储双向队列元素的数组
private var front = 0 // 队首指针,指向队首元素
private var queSize = 0 // 双向队列长度
private var nums: IntArray = IntArray(capacity) // 用于存储双向队列元素的数组
private var front: Int = 0 // 队首指针,指向队首元素
private var queSize: Int = 0 // 双向队列长度
/* 获取双向队列的容量 */
fun capacity(): Int {
@@ -71,7 +72,7 @@ class ArrayDeque(capacity: Int) {
return num
}
/* 访问队尾元素 */
/* 队尾出队 */
fun popLast(): Int {
val num = peekLast()
queSize--