Data Structures & Alogs HW_Part_21

Data Structures & Alogs HW_Part_21 - 81 / Insert...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
81 // Insert element from second matrix this.insert(curr2->value, curr2->row, curr2->col); curr2 = curr2->nextcol; } else { // This element in both matrices this.insert(curr1->value + curr2->value, curr2->row, curr2->col); curr1 = curr1->nextcol; curr2 = curr2->nextcol; } } } 12.12 This is quite simple. The memory pool is simply viewed as a stack. Re- quests pop off the requested amount of storage (move the top pointer down). Returns push the storage back on the stack (move the top pointer up). Just re-implement the stack functions for variable length records. 12.13 Simply manage the memory pool as an array-based queue, with variable length records. Memory requests move the rear pointer by the appropriate amount; memory returns move the front pointer by the appropriate amount. 12.14 (a) 1300, 2000, 1000 (b) 1000, 2000, 1300 (c) 900, 1300, 1100, 1000
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
13 Advanced Tree Structures 13.1 0/ \1 ----- ----- 0 /\1 ------ \ \ || | 0/\1 / /\ 0 / |3 14 25 0 | 0/ \1 / 0 / 7| | 0/ \1 0/ \1 | 12 99 100 0/ \1 10 11 13.2 0 --- --- ----- \ / \ 2 2 99 100 82
Background image of page 2
83 3 3 14 95 0 /\ 74 51 2 10 11 13.3 Binary Trie insertion routine. Assume that the Trie class has a root pointer
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 10/31/2011 for the course BCN 3431 at University of Florida.

Page1 / 4

Data Structures & Alogs HW_Part_21 - 81 / Insert...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online