Sunday, August 11, 2019
Discussion questions 1-6 Assignment Example | Topics and Well Written Essays - 500 words
Discussion questions 1-6 - Assignment Example They both involve finding the minimum or maximum in a set of unfamiliar real variables. A good example is how petroleum products are usually transported, that is transportation from production point to the end user involves a wide range of modes of transport which include tank ships, rail tankers and pipelines. Each mode of transport here has disadvantages but are nonetheless each used in the transportation of petroleum products from the source to the end user. I do agree with Dustin in that a vector is a collection of data of the same type. Vectors help in that the minimize repetition and coding if there is a wide range of data of the same type. Vectors are good I that; they remove or add elements; it access character elements by their location indices and they iterate elements through any order. Vectors perform almost the same way as arrays but also give room for expanding. However they take up more memory space than arrays. This is to allow for future growth. This is also true. A vector is indeed a compilation of data of the same type. However, vectors are also implemented as dynamic arrays meaning that their elements can also be accessed using offsets pointers to the elements. Generally, vectors are generally the fastest when it comes to adding, removing and accessing elements from the end sequence. However, in some situations they donââ¬â¢t perform well. These situations include when removing and adding elements in other positions other than the sequence end This is true, an array should also be declared before being implemented. You should feed the compiler what type of array being defined. Arrays take up less space than vectors hence limiting their efficiency. However, arrays are best used when the data is minimal and when removing and adding elements that are not at the end of the sequence. This is true. Arrays are referred to low level abstraction because they cannot be defined and the code
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.