Preview

Data Types and Components of Data Structure

Better Essays
Open Document
Open Document
3449 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Data Types and Components of Data Structure
TYPES OF DATA AND COMPONENTS OF DATA STRUCTURES

Data types 1. Primitive: is a data type provided by a programming language as a basic building block 2. Composite: is any data type which can be constructed in a program using its programming language's primitive data types and other composite types 3. Abstract: is a mathematical model for a certain class of data structures that have similar behavior; or for certain data types of one or more programming languages that have similar semantics
TEN COMPONENTS OF DATA STRUCTURE A. Array
Arrays are one of the simplest and most widely used data structures in computer programs. Arrays in any programming language all share a few common properties: • The contents of an array are stored in contiguous memory. • All of the elements of an array must be of the same type or of a derived type; hence arrays are referred to as homogeneous data structures. • Array elements can be directly accessed. With arrays if you know you want to access the ith element, you can simply use one line of code: arrayName[i].
The common operations performed on arrays are: • Allocation • Accessing
An array holds several values of the same kind. Accessing the elements is very fast. It may not be possible to add more values than defined at the start, without copying all values into a new array.

B. List
A List can hold several values. Each item in the list has a way of telling where the next element is; some lists can also tell where the previous element is. It is very easy to add a new element at the start of the list; telling whether an element is already in the list is more difficult, and needs going through all elements of a list.
Here are all of the methods of list objects: list.append(x) Add an item to the end of the list; equivalent to a[len(a):] = [x]. list.extend(L)
Extend the list by appending all the items in the given list; equivalent toa[len(a):] = L.
list.insert(i,

You May Also Find These Documents Helpful

  • Satisfactory Essays

    PT2520 Unit7Labs Tramil

    • 330 Words
    • 1 Page

    12. What is a composite key? A key that consists of more than one attribute.…

    • 330 Words
    • 1 Page
    Satisfactory Essays
  • Good Essays

    I = { . . ., -4, -3, -2, -1, 0, 1, 2, 3, 4, . . .}.…

    • 1254 Words
    • 6 Pages
    Good 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
  • Powerful Essays

    Nt1330 Unit 1 Research Paper

    • 4285 Words
    • 18 Pages

    Each character requires one byte as it is usually stored as an ASCII character. Notice that a digit such as 8 could be held as either a character, an integer or even a real. If any calculations are going to take place on the value then it should be held as either an integer or a real. If the calculation will never result in it being extremely large or gaining decimal places then an integer should be used.…

    • 4285 Words
    • 18 Pages
    Powerful Essays
  • Good Essays

    Array Structure Paper

    • 833 Words
    • 4 Pages

    “An array is a collective name given to a group of similar quantities. These similar quantities could be percentage marks of 100 students, number of chairs in home, or salaries of 300 employees or ages of 25 students. Thus an array is a collection of similar elements. These similar elements could be all integers or all characters, and so on” (Thompson, 2007). Building an array can be confusing for the Bug Blasters can be very confusing for a programmer who does not fully understand how they work.…

    • 833 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Chapter 8 Quiz

    • 469 Words
    • 2 Pages

    2. What is the term used for the number inside the bracket that specifies the number of values that an array can hold? (Points : 7)…

    • 469 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    ch02 c

    • 2468 Words
    • 11 Pages

    9. The term “data structures” refers to the speed at which data it is captured, analyzed, and reported.…

    • 2468 Words
    • 11 Pages
    Powerful Essays
  • Good Essays

    7 and Array

    • 500 Words
    • 2 Pages

    7. When a single array element, such as myArray[2], is passed to a method, the method receives _____.…

    • 500 Words
    • 2 Pages
    Good Essays
  • Good Essays

    1. In the statement, x =3;, the ' =' operator is one of Java's extended assignment operators.…

    • 719 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    E4.6: The label array_x is the starting address of an array of 100 8bit elements.…

    • 900 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    MIS Section3&4

    • 255 Words
    • 2 Pages

    13. The type of logical database model that treats data as if they were stored in two-dimensional tables is the:…

    • 255 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    It Final Essay Example

    • 539 Words
    • 3 Pages

    3. (TCO C) The type of logical database model that treats data as if they were stored in two-dimensional tables is the (Points : 8)…

    • 539 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    It 218 Week 4 Checkpoint

    • 290 Words
    • 2 Pages

    An array is a variable that holds more than more than one value, and an array can be combined with multiple variables for a more complex structure. An array is declared much similar with any other variable. The only difference is the number of elements is shown in brackets. An example of an array will be look much like these three: calories [ min ], 30 [ 7 ], and feet [ 12 ]. Each one of these arrays can be used as long as it is appropriate for the program.…

    • 290 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Week 3

    • 754 Words
    • 4 Pages

    6. The type of logical database model that treats data as if they were stored in two-dimensional tables is the (Points : 1)…

    • 754 Words
    • 4 Pages
    Satisfactory Essays
  • Powerful Essays

    Linked List

    • 3270 Words
    • 14 Pages

    – Successive elements are connected by pointers. – Last element points to NULL. – It can grow or shrink in size during execution of a program. – It can be made just as long as required. – It does not waste memory space. A…

    • 3270 Words
    • 14 Pages
    Powerful Essays