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 also have the requirement that the pointer type must be of the same data type as the variable, or the data that it points to or holds the address of. The power of pointers also hints at the potential complexity of their use, which is why this lab is focused almost entirely on several different aspects and uses of pointers. The lab also introduces pointer arrays and pointers to pointers.…

    • 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
  • Satisfactory Essays

    DBM 380 Syllabus

    • 623 Words
    • 4 Pages

    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?…

    • 623 Words
    • 4 Pages
    Satisfactory 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

    Deletion Basic Array Dynamic Array Singly-Linked List Doubly-Linked List Skip List O(1) O(1) O(n) O(n) O(n) O(n) - - O(n) O(1) O(n) O(n) O(log(n)) Hash Table Binary Search Tree Cartresian Tree B-Tree Red-Black Tree Splay Tree AVL Tree…

    • 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
  • 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
  • Better Essays

    Symbol Table

    • 1792 Words
    • 8 Pages

    A symbol table mechanism must allow us to add new entries and find existing entries. The two symbol table mechanisms are linear lists and hash tables. Each scheme is evaluated on the basis of time required to add n entries and make e inquiries. A linear list is the simplest to implement, but its performance is poor when n and e are large. Hashing schemes provide better performance for greater programming effort and space overhead.…

    • 1792 Words
    • 8 Pages
    Better Essays
  • Good Essays

    Relational Databases

    • 750 Words
    • 3 Pages

    Data for our programs are stored in various formats. The most commonly used format is in the form of a database since databases are not dependent on a single program or hardware platform. These databases are stored in five structures of hierarchical, network, relational, multidimensional, and object-oriented. Hierarchical structure organizes data in a one to many relationship. The network goes of the hierarchical structure by organizing data in a many to many relationship. The relational structure organizes the data in tables and allows the end user to determine the relationship at run time. Multidimensional takes the relational structures concept and uses multi dimensions to organize the data. Object-oriented structure has not only the attributes of the entity, but also contain the operations that can be performed on it.…

    • 750 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Task 1

    • 2644 Words
    • 8 Pages

    Also it is difficult to create new data types so this in turn reduces extensibility.…

    • 2644 Words
    • 8 Pages
    Powerful 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
  • 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

Related Topics