Data Structures

Cards (11)

  • Describe the difference between an array and a linked list
    Linked list is a dynamic data structure whereas arrays are static
    In an array every element can be accessed directly whereas in a linked list you need to traverse through until the desired element is found
    In an array the contents are stored continuously in memory
  • Decsribe what is meant by the term 'Linked List'
    A dynamic data structure that has nodes. Each node consists of data and a pointer that gives the location of the next node
  • Explain why a hash table is better suited than a linked list
    Linked list takes longer to search as it requires every node to be checked until desired element is found Whereas, hash table enables direct access to the location where the desired element is found
  • Advantage of using Binary Search tree over an array
    Binary Tree can be searched quicker than an array
  • State the meaning of static
    size is fixed when the structure is created. The size cannot change during processing.
  • State one type of data structure that is always static
    Array
  • State meaning of dynamic
    Size can change during processing
  • Give one disadvantage of using a dynamic data structure
    more difficult to program and the storage required initially is unknown
  • Explain two characteristics you would look for in a hashing algorithm
    Quick to calculate as lots of files need to be hashed
    Provides a smaller output than input so it is quicker to compare the hashes than original data
    Low chance of collision to reduce the risk of different files being marked as the same
  • Tuple
    static/immutable/unordered collection of items that cannot be replaced
    or can store more than one data type
  • What do casting functions do?

    turn one data type into another