Discussion Assignment Unit 5 PDF

Title Discussion Assignment Unit 5
Author Amos kibet
Course Programming 2
Institution University of the People
Pages 2
File Size 63.7 KB
File Type PDF
Total Downloads 78
Total Views 157

Summary

Discussion Assignment submission Discussion Assignment submission Discussion Assignment submission Discussion Assignment submission Discussion Assignment submission Discussion Assignment submission Discussion Assignment submission Discussion Assignment submission Discussion Assignment submiss...


Description

Learning Journal Unit 5 This week we continued our journey to discover more data structure that we can use to build even more robust, efficient as well as less prone to errors programs. We specifically looked at the lists, sets and maps in java with the emphasis on the appropriate use we can make of these data structures. List which came into two categories namely arrayLists and LinkedLists were also covered alongside sets and maps in java. In the discussion forum, we had a chance to look at an important question that of knowing when it is appropriate collection framework from all these data structure we have studied so far. Many things could be said about this but we took home that in order to know the right collection to use for a particular projection the programmer needs to know what the what functionality the class or classes he or she is building will need. As the same problem could be solved using different collections in java but some collection may come with additional features that will not probably be used and as result could just using additional space and hence slowing down the execution of our program. We reviewed some key features that different collections come with and when it was adequate to use them. Below if a brief description of different data structure and when to use them. Lists will be useful under the following circumstances: 

Essentially a variable-size array.



You can usually add/remove items at any arbitrary position.



The order of the items is well defined (i.e., you can say what position a given item goes in in the list). (Eck,2019) Sets will be useful under the following conditions:



Things can be "there or not"— when you add items to a set, there's no notion of how many times the item was added, and usually no notion of ordering.



Remembering "which items you've already processed", e.g., when doing a web crawl



Making other yes-no decisions about an item, e.g., "is the item a word of English", "is the item in the database?”, "is the item in this category?" etc. (Eck,2019) Maps will be ideal in the following situation.



Stores an association or mapping between "keys" and "values". Maps are most appropriate where you need to say, "for a given X, what is the Y"? It is often useful for implementing in-memory caches or indexes.



Queues Like a list, but where you only ever access the ends of the list (typically, you add to one end and remove from the other). (Eck,2019).

To be honest, I can say that I have learnt a lot so far. I have learnt data structures that I had not heard of before and wrote code in them. I have reached a level where I can look at any code and after reading it, I can understand what it is all about. This was not the case a couple of weeks ago. However, I still feel I need to continue to read more and more java code and try to understand how the programmers were thinking when they wrote them. I am also sure of one thing, that I keep the same pace and continue sharpening my java skill for several months to come I am likely going to surprise by what I will be able build in java. I can’t wait to become a truly software engineers. Reference: Eck, D. J. (2019). Introduction to programming using Java, version 8.1. Hobart and William Smith Colleges. http://math.hws.edu/javanotes....


Similar Free PDFs