Preview

Parallel Arrays

Good Essays
Open Document
Open Document
427 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Parallel Arrays
Parallel arrays and arrays of structures

An array of structures are usually equivalent to parallel arrays of the components.
For example, if each student record consists of an ID number and a GPA value, then a list of students can be represented as an array of structure:
The same data can be stored as two arrays that "parallel" to each other, in the sense that the same index in them indicate data for the same student:
Usually the first way is more natural and convenient.

Advantages and disadvantages
Against Arrays

Compared to arrays, linked data structures allow more flexibility in organizing the data and in allocating space for it. With arrays, we must choose a size for our array once and for all; this can be a potential waste of memory. A linked
Data structure is built dynamically and never needs to be bigger than the programmer requires. It also requires no guessing in terms of how much space you must allocate when using a linked data structure. This is a feature that is
Key in saving wasted memory. The nodes of a linked data structure can also be moved individually to different locations without affecting the logical connections between them, unlike arrays. With due care, a process can add or delete nodes to one part of a data structure even while other processes are working on other parts. On the other hand, access to any particular node in a linked data structure requires following a chain of references that stored in it. If the structure has n nodes, and each node contains at most b links, there will be some nodes that cannot be reached in less than log b n steps. For many structures, some nodes may require worst case up to n -1 steps.
In contrast, many array data structures allow access to any element with a constant number of operations, independent of the number of entries.
General Disadvantages
Linked data structures also may also incur in substantial memory allocation overhead (if nodes are allocated individually) and frustrate

You May Also Find These Documents Helpful

  • Satisfactory Essays

    What limitations have you or someone you know encountered in the past in using nonrelational structures (such as in a Microsoft® Excel® or Word file) to store data? What were the advantages?…

    • 644 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    Arrays store items that have the same type of data type like a group of employees’ names and social security numbers for a team of 2000 personal. Pointer is a variable that greatly extends the power and flexibility of a program, each memory location that is used to store data value has an address. The address provides the means for a PC hardware to reference a particular data item.…

    • 485 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Comp 220

    • 1463 Words
    • 6 Pages

    Pointers are, essentially, address variables, or variables that hold as their value the address of other variables. In terms of memory management, they are very powerful devices, and they more closely and efficiently use the actual internal hardware registers of the microprocessor that the program operates on.…

    • 1463 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    CIS 1 Ch 11 Part 2

    • 240 Words
    • 2 Pages

    10. (1 point) A(n) _____________________________ is a field that contains data unique to a record.…

    • 240 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Array Structure Proposal

    • 574 Words
    • 3 Pages

    An array is a variable that holds multiple values of the same kind. Nearly every…

    • 574 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    It 210

    • 2960 Words
    • 12 Pages

    Although the value of a variable may change during execution of a program, in all our programs so far, a single value has been associated with each variable name at any given time. In this chapter, we will discuss the concept of an array—a collection of variables of the same type and referenced by the same name. We will discuss one-dimensional arrays (lists) at length and focus briefly on twodimensional arrays (tables). You will learn how to set up and use arrays to accomplish various tasks.…

    • 2960 Words
    • 12 Pages
    Powerful Essays
  • Good Essays

    O(n) O(n^2) O(n+k) O(nk) O(n^2) O(n^2) O(nk) O(1) O(nk) O(n+k) O(1) O(1) O(1) Data Structures Data Structure Time Complexity Indexing Average Search Insertion…

    • 990 Words
    • 18 Pages
    Good Essays
  • Satisfactory Essays

    A disadvantage to the Multi-Store Model of Memory is that it may be over simplifying the memory processes. This model of memory doesn’t take into consideration that there are different kinds of…

    • 451 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Symbol Table

    • 1792 Words
    • 8 Pages

    Each entry in the symbol table is for the declaration of a name. The format of entries does have to be uniform, because the information saved about a same depends on the usage of time. Each entry can be implemented as a record consisting of a sequence of consecutive words of memory. To keep symbol table entries uniform, it may be convenient for some of the information about a name to be kept outside the table entry, with only a pointer to this information stored in the record.…

    • 1792 Words
    • 8 Pages
    Better Essays
  • Good Essays

    It surprises me that data structures can look simple but once you start creating them it involves a lot of thinking and planning.…

    • 605 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    This will allow you to different data so you do not have any duplicates so each piece of data is different. Schools, colleges, and theme parks could use a relational database so that they never have duplicates. Also, it makes inputting data a lot.…

    • 557 Words
    • 3 Pages
    Satisfactory Essays
  • Best Essays

    More details can be found in [7]. 1We use the standard notation B to denote the block size, andN the total number of elements inserted. For the analysis, we assume entries (including pointers) are of equal size, so B is the number of entries per block. A versioned B-tree is of great interest to storage and file systems. In 1986, Driscoll et al.…

    • 4093 Words
    • 17 Pages
    Best Essays
  • Good Essays

    · Possibility of data duplication as there's no repetition check like in computer software's e.g. Microsoft Access.…

    • 395 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Chefe

    • 690 Words
    • 3 Pages

    During this course we will follow the same data storing structure as used by the…

    • 690 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Bullshit 101

    • 822 Words
    • 3 Pages

    CE 323 Assignment 3 Design Pattern Mustafa Mohammad Ghazanfar 2011329 12/16/2013 Strategy Pattern: Strategy pattern can be used in cases where behaviours of certain elements can be separated from other parts as independent processes. For example designing a strategy pattern for a car would result in multiple functions like brakes, boot, windows etc. All will have separate functions yet come together to complete the car. This pattern works by encapsulating all the functions as separately as possible and all the while keeping the client encapsulated from majority of the algorithm.…

    • 822 Words
    • 3 Pages
    Good Essays

Related Topics