This preview shows page 1. Sign up to view the full content.
Unformatted text preview: p := p ↑ .next ; q := q ↑ .previous end end The time complexity is O(n). 7. Redo (6) assuming an array implementation of lists. Design and array implementation which in your opinion guarantees the lowest time complexity. Justify your design. a. 3ONLY(L). The procedure deletes from L all elements except those on 3k+1, k $ 0, positions. For instance if L=2,3,1,5,7,8,9 then 3ONLY(L) = 2,5,9, i.e. only positions 1,4,7 are left. procedure 3ONLY(L: List;); var n : integer;...
View Full Document
This note was uploaded on 12/10/2009 for the course CAS 2c03 taught by Professor Janicki during the Spring '03 term at McMaster University.
- Spring '03