Midterm exam 1 review Sp2006: Properties and Data Structures
Questions, comments, concerns, answers, concerns about answers?
(Back to Midterm Exam 1 Review Sp2006)
I think I got these straight... Let me know, anybody, if you spot a problem!
Array:ACDG
LL:BEFH
A/E: Arrays just need the index of the element and you're done. LLs need to be traversed–that whole while(current!=null) if(current.getNext()==target) thing.
B/C: For arrays, increment index by one, that's it. For LLs, you have to set up the whole getNext()/setNext structure, and use that while loop...
D/F: Arrays required copying every single element after the insert/delete point over. LLs just had you move a node's next to a new node, set its next to the old next. 2 moves.
G/H: Well, arrays have a static size and LLs have a dynamic size. No magical logic there...
I agree and, I like the explanations.
I got the same answers.
G: No magical logic, but static size means that the size of an array cannot be changed after the code has been written and compiled.
H: REMOVEDked Lists are considered to be a dynamic size because objects can be inserted, deleted, and the order can be changed after the code is written.
I figured I would explain those a little more...
Jim you've got to give others a chance! You had these posted before some people ever looked at it!!!
Michael Campbell
Yeah, well, it was like, 2 days before the exam, and nobody had posted a single thing... I was getting anxious. :)
I'll wait in the future, if you prefer.
Student248
No! I was just kidding. You stay on top of it. It is really helpful to the rest of the class.
Michael Campbell
Link to this Page