Polish the chapter of array and linkedlist

This commit is contained in:
krahets
2023-08-17 05:13:19 +08:00
parent 0858ab91c0
commit c310edb672
26 changed files with 287 additions and 236 deletions

View File

@ -4,7 +4,7 @@
* Author: nuomi1 (nuomi1@qq.com)
*/
/* */
/* 访 */
func randomAccess(nums: [Int]) -> Int {
// [0, nums.count)
let randomIndex = nums.indices.randomElement()!

View File

@ -7,8 +7,8 @@
/* */
class ListNode {
var val: Int //
var next: ListNode? //
weak var prev: ListNode? //
var next: ListNode? //
weak var prev: ListNode? //
init(val: Int) {
self.val = val