[personal profile] aklepatc
Code a data structure with 2 operations: push() and popMostFrequent().

Most of the meat is in the comments/discussion below.

Date: 2024-05-09 07:42 am (UTC)
From: [personal profile] sassa_nf
Good point about clearing the reference. But the order may matter.

Eg

v, c.L[j], c.L[j][0] = c.L[j][0], c.L[j][1:], nil

c.L[j][0] on the left - does that refer to the c.L[j] before or after assignment of c.L[j][1:] to it?

Profile

aklepatc

May 2024

S M T W T F S
   1234
567 891011
12131415161718
19202122232425
262728293031 

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 16th, 2025 03:55 pm
Powered by Dreamwidth Studios