我在构建一个霍夫曼树时遇到了一些问题。在构建霍夫曼树时,我使用min-heap来实现。我认为min-heap的代码运行良好,但是当我运行building-huffman-Tree代码时,会出现错误。我已经挖了很长时间了,但是我没有办法解决它。希望有人帮助我解决我的问题。代码如下:
IF NOT EXISTS(SELECT 1
FROM dbo.eventmarkets
WHERE it = '59902852C13-1763_1_3')
BEGIN
INSERT INTO dbo.eventmarkets(it, ov, market, eventid, status, marketid)
VALUES ('59902852C13-1763_1_3', '59902852C13-1763_1_3', 'google some', '15312738825C13_1_3', 0, 1763)
END
ELSE
BEGIN
UPDATE dbo.eventmarkets
SET ov = '59902852C13-1763_1_3',
market = 'google some',
eventid = '15312738825C13_1_3',
status = 0,
marketid = 1763
WHERE it = '59902852C13-1763_1_3'
END