day14 - COP 3503 Computer Science II CLASS NOTES DAY#14...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
COP 3503 – Computer Science II CLASS NOTES - DAY #14 As we begin the second half of the course, our focus shifts from examining problem-solving techniques and asymptotic algorithm analysis toward the issues involved with the implementation of the basic data structures which support the problem-solving techniques incorporated in our algorithms. For most of the data structures that we have examined a basic implementation issue centers on whether the structure is implemented in a static or dynamic fashion. The selection of a static or a dynamic implementation often depends on problem specific issues commonly related to either speed of execution or knowledge of the size of the problem instances which are to be expected. A static implementation implies that the structure will be implemented using an array. In most (but not all) programming languages arrays are statically allocated chunks of contiguous memory addresses. A dynamic implementation implies that the structure is implemented using memory locations which are allocated during execution of the algorithm. Since the program is in execution at the time a memory request occurs, support from the run-time environment is required (this means OS support). This run-time support comes with a price tag of increased overhead in the execution of the program (the overhead manifests itself primarily in terms of time) with the benefit of implementation and instantiation flexibility. As we move, once again, through a number of different data structures, you should keep in mind that most of them can be implemented either statically or dynamically. For some of them we will look at both types of implementations, but for the most part we will be assuming a dynamic implementation. As we examine the implementation issues surrounding these data structures we will focus predominantly on two areas: (1) ensuring that the implementation satisfies the asymptotic behavior that we expect for the various operations that are allowed on the structure, and (2) the implementation is done in such a way that it is efficient in time and space while incorporating the design aspects of the OOP paradigm. Traditionally, dynamic structures imply the use and manipulation of pointers or pointer variables . There is a common misconception that Java does not support pointers. This is not true, per se. In Java, every variable that is not one of the primitive types is a reference type. Such a variable is can be thought of as a reference to (or a pointer to ) an object of the appropriate type. Thus, Java supports references and not pointers. The primary difference in this area between, say Java and C, is that C supports pointer arithmetic and Java does not. This is a safety feature incorporated in Java which prevents access through a pointer to an address Day 15 - 1 Implementation Issues
Image of page 1

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

View Full Document Right Arrow Icon
outside the addressing scope of your program and prevents either accidental or malicious memory address violations.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern