CSCI 3137 - Assignment 1- Variable Models


  • 作业标题:CSCI 3137 - Assignment 1: Variable Models
  • 课程名称:Dalhouse University CSCI 3137 Principles of Programming Languages
  • 完成周期:3天

Question 1: Variable Models and Pointers

C has pointers, Java does not. I claim that if C did not have pointers, this would severely limit the types of things one can do in C, whereas Java has no such limitation.

  • Provide an example of a data structure that can be implemented in Java and in C, but which would not be implementable in C if C did not have pointers.

  • Explain why this data structure would not be implementable without the use of pointers in C and why we can implement this data structure in Java even though Java does not have pointers.

。。。

Question 2: Runtime Implications of Variable Models

In class, I claimed that part of the reason why performance-oriented languages, such as C, C++, and Rust, use a value model of variables is that this often leads to faster code. In reality, things are a bit more complicated. Consider the following operations on a large array

。。。

Submission

Assignments are due by 11:59 PM on the due date. Assignments must be submitted electronically via Brightspace. Only a single PDF is accepted. You can do your work on paper and then scan it and submit the scanned. If at all possible, scan your assignment instead of taking a photo. The result will be more readable. If you do need to take a photo, ensure proper lighting and that the camera is properly focused. If the marker cannot read your work, you don’t earn any marks. Even if you take a photo or photos, it is your responsibility to convert the photos to a single PDF with the pages in the correct order.


文章作者: IT神助攻
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 IT神助攻 !
  目录