Sunday 12 May 2013

Data Structure


By
Raul Bernardino (Dino), B of Comp. Sc., MSc in ISM

Introduction:
Lists and Queues are enormously used in the operating systems whereas to control various tasks in different stages of the execution. These tasks are stored in the queues and it structured by first in first out (FIFO), (Brookshear, 2009:374). This operation is proper for certain application; however it is not use for controlling blocks in the operating system. The operating system much more efficient by using high priority task first or use simultaneously (lists).
[2] List in Data Structure:
A listing or computing is a data structure values that’s in sequence, where the same value can be occurred in more than one place. In computing or listing of data types can also view as model of mathematics, which has similar behavior for certain class of the data structures.  An instance of a value in the list is usually called an element.  In a listing, we can also make a link to the list of the data structure itself, where it consists of an order of data records.  The records are fields that contain an address to the next record in the sequence. This is allow us, to easily shorting a data, adding new data or insert new data and delete data, or easily moves data from list to other end.
A field of node contains information of next node calls a pointer. A first node is a HEAD of a list and the last node calls TAIL minus that node.



A circular link diagram




[5] A single link diagram



[4] A doubly link diagram

[3] Queue in Data Structure:

Queues in general as it pictured below is FIFO model. FIFO stands for First In First Out.









FIFO queue model
A queue is group whereas members are a collection of objects that keeps in the line. The elements can be only adding from the back and only deleting or removing from the front. Some examples are the queues in front of the cashier for the payment or deposits in the banks. The cashier will be only serving the first-in person in the queues. The queues also have a limited to the available of the rooms, places or buffers in the case of computing.
There are two term for queue which are overflow and underflow. The overflow is adding a new object to the full queue. The underflow is deleting object from an empty queues.

Some questions about memory mapping
#1.  Suppose a homogeneous array with 6 rows and 8 columns is stored in row major order starting at address 20 (base ten).  If each entry in the array requires only one memory cell, what is the address of the entry in the third row and fourth column? What if each entry requires two memory cells?

When data is stored in the rows, the major order of the rows are stored first horizontally in adjacent memory locations. When one row is stored, the next one is stored adjacent to the last entry in the previous row.

1 memory cell per item of the data
In the above scenarios, if the starting location was 20 the first row of data would be stored in locations of 20 to 27 and the second row would be stored in locations 28 to 35 and the third row would be stored between locations 36 to 43. The location of the 3rd row and 4th column would thus be 39

[6] 2 memory cells per item of data
In the above scenario the first row would occupy memory locations 20 to 35, the second row would be stored between locations 36 to 51 and the third row would be stored between locations 52 to 67. So the required entry would be stored in memory location 58 to 59.

#2. Describe a method for storing three-dimensional homogeneous arrays. What addressing formula would be used to locate the entry in the ith plane, jth row, and the kth column?

Ordinarily, the values posed within the question would be stored within the computer memory in one of two ways (Row major order or Column major order). These are then grouped together within the computer’s memory. When this is done, we can refer to the location by specifying the row and column. For this exercise, we will also add the plane data for further location (a little like locating an object floating in a cube).
Therefore, if we suppose use the following formula:
X = Address of the cell containing the entry
For this exercise:
I = 4
J = 10
K = 11 (Represents the number of columns)

X + (K*(I – 1)) + (J – 1)
รจ X + (11*(4 - 1)) + (10 – 1) = 42
Answer = 42
The answer or information can then be translated through the use of software routines into locations within the computer’s memory. In this case 4,2.

Moreover, there are some related questions in the software engineering as follows:
#3.  Explain how the lack of metrics for measuring certain software properties affects the software engineering discipline.
Unlike the traditional engineering disciplines where concrete and quantitative, methods for verification of the product, software engineering isn’t blessed with such methods. These methods are called metrics and lack of them is a cause for various problems with software systems. The most immediate impact of the lack of quantitative metrics is the unreliable nature of the end product. Software that can’t be verified can never be sure to perform consistently under all possible operating conditions.

Unless suitable metrics are found for testing the validity of software to the same degree of effectiveness as other more traditional engineering disciplines it is going to be hard to argue the case for software engineering to be considered as part with traditional engineering disciplines. Brookshear [1] compares the current state of software engineering to the position mechanical engineering was in the early seventeenth century before Newton and others discovered the basic mathematical measurements for mass, acceleration and force and their interrelation.

Research in software engineering would have to focus on the discovery of similar fundamental principles which can be applied generically to all software development endeavors. At present most development projects are engineered from scratch.

Although the lack of quantitative metrics affects all aspects of software engineering but the following are perhaps affected more heavily.
Reliability
Software cannot be guaranteed to be reliable if all new projects are developed from scratch as all the mistakes are repeated again and again. The idea of building entire software systems from prefabricated modules using them as building blocks is the focus of much research and interest in the IT community.
Testing
Non existence of any quantitative measures for testing software results in systems rigged with errors which on occasions have caused catastrophic results and have come very close to total destruction. The big hurdle in the way is the intolerance of errors in software systems where software either functions properly without errors or produces the wrong results with the presence of the smallest of error (a missing expression or a wrong operator). It is the effort of eliminating the construction of primitives every time software is developed that is the goal of so many academic and commercial organizations.
Security
With the advent of distributed systems and the explosion in e-commerce and internet systems security has become a major issue is software systems. As software systems cannot yet be defined and tested for all their operating states it is impossible to plug every security hole in the system and discover every error that may exist.
Project Management
The unpredictable nature of software projects puts incredible strain on those tasked with managing the projects. They are often asked to make assumptions about the likely cost of developing a system before any design work has been done and as there exist no metrics for defining a project’s work breakdown structure and the effort associated with them.
Estimating
Software project estimation remains a work of art than a science due to the lack of metrics in the software engineering discipline.

#4. What is the difference between coupling and cohesion? Which should be minimized and which should be maximized?
Coupling refers to the connections between modules; cohesion refers to the connectivity within a module. On the surface, one would like to minimize coupling (because that leads to independent modules that can be maintained individually) and maximize cohesion (because that leads to modules whose activities can be more easily understood).

References:

[1] Brookshear, J. (2009) Computer Science: An Overview. 10th ed. Boston: Pearson Education, Inc.
[2] List or computing [Internet]. Available from: http://en.wikipedia.org/wiki/List_(computing)  (Accessed: 13 November  2010)

[3] Queue of data structure [Internet]. Available from: http://en.wikipedia.org/wiki/Queue_(data_structure) (Accessed: 13 November 2010)

[4] Double link list [Internet]. Available from: http://en.wikipedia.org/wiki/File:Doubly-linked-list.svg  (Accessed: 13 November 2010)

[5] Single link list [Internet]. Available from: http://en.wikipedia.org/wiki/File:Singly-linked-list.svg (Accessed: 13 November 2010)
[6] Multidimensional Array [Internet]. Available from: http://courses.cs.vt.edu/~csonline/DataStructures/Lessons/2DArrays/index.html (Accessed: 13 November 2010)