GoConqr has a new look! Let us know what you think.

Flashcards

Exam 1

Siah Thomas English 28 cards

Cards in this deck (28)

  1. 1Data type and examples- a name
    - for a set of legal values
    - and a set of operations
    examples: int, short, byte, long, boolean, double, float, char
    String, Object, List, Map, Stack, Queue…
  2. 2abstract data type (ADT)a data type that has values and operations not defined in the language itself
    - in Java an ADT is implemented using a class (abstract or not) or interface
  3. 3A solution is said to be _________ if it solves the problem within its __________ _________. What are these?Efficient, resource constraints
    - space
    -time
  4. 4The _____ of a solution is the amount of resources that the solution consumescost
  5. 5What is the cardinality of B ? B = {2, 3, 5, 7, 3, 2}4
  6. 6A = {3, 5} and B = {2, 3, 5, 7} Is A a subset of B and why? Is A a proper subset of B and why>A is a subset of B because every element in A is also in B. And A is a subset of B because every element in A is also in B.
  7. 7𝐴={π‘Ÿπ‘’π‘‘, 𝑏𝑙𝑒𝑒, π‘”π‘Ÿπ‘’π‘’π‘›} 𝐡={π‘¦π‘’π‘™π‘™π‘œπ‘€, π‘œπ‘Ÿπ‘Žπ‘›π‘”π‘’, π‘Ÿπ‘’π‘‘, π‘π‘’π‘Ÿπ‘π‘™π‘’, π‘”π‘Ÿπ‘’π‘’π‘›} 𝐴βˆͺ𝐡? 𝐴∩𝐡? π΄βˆ’π΅? π΅βˆ’π΄?𝐴βˆͺ𝐡={π‘Ÿπ‘’π‘‘, 𝑏𝑙𝑒𝑒, π‘”π‘Ÿπ‘’π‘’π‘›, π‘¦π‘’π‘™π‘™π‘œπ‘€, π‘œπ‘Ÿπ‘Žπ‘›π‘”π‘’, π‘π‘’π‘Ÿπ‘π‘™π‘’}
    𝐴∩𝐡={π‘Ÿπ‘’π‘‘, π‘”π‘Ÿπ‘’π‘’π‘›}
    π΄βˆ’π΅={𝑏𝑙𝑒𝑒}
    π΅βˆ’π΄={π‘¦π‘’π‘™π‘™π‘œπ‘€, π‘œπ‘Ÿπ‘Žπ‘›π‘”π‘’, π‘π‘’π‘Ÿπ‘π‘™π‘’}
  8. 8Seta collection of distinguishable elements
    e.g. {3, 4, 5, 4} = {3, 4, 5}
  9. 9Baga collection of elements with no order but with duplicates as a this
    [3, 4, 5, 4] = [3, 4, 4, 5] β‰  [3, 4, 5]
  10. 10sequence (tuple, vector)is a collection of elements with an order which may or may not contain duplicates
    <3, 5, 4, 4> β‰  <3, 4, 5, 4> β‰  <3, 4, 5>
  11. 11R is a binary relation over S. How can it be reflexive, symmetric, antisymmetric, or transitive?R is reflexive if aRa for βˆ€a∈S
    R is symmetric if aRb => bRa for βˆ€a,b∈S
    R is antisymmetric if both aRb and bRa hold => a=b for βˆ€a,b∈S
    R is transitive if aRb and bRc => aRc for βˆ€a,b,c∈S
  12. 12What is an equivalence relatioEquivalence relation: R is reflexive, symmetric and transitive
  13. 13What is a partial order?R is reflexive and antisymmetric and transitive
  14. 14The time complexity of an algorithm depends on:the number of basic operations required by the algorithm to process an input of certain size
  15. 15basic operationan operation whose time to complete does not depend on the particular value of its operands
    - e.g. adding two integers doesn’t depend on the values of the integers: 3+5 takes the same time as 73+8734
  16. 16when working with lists of values to search, sort etc., ____ is the number of elements processedsize
  17. 17The rate for which the cost of the algorithm grows as the size of the input ________grows
  18. 18asymptotic upper boundfor the growth of the algorithm’s runtime (highest possible growth rate of the algorithm, worst case) - Big-Oh Notation
  19. 19asymptotic lower boundfor the growth rate of the algorithm (least possible cost (usually time) required, best case) – Big-Omega Notation
  20. 20tightest bound- if the worst case Big-Oh and best case Big-Omega are the same within a constant factor (best of all the worst case runtimes) - Big-Theta Notation
  21. 21Main Memory Space/Time TradeoffYou can often reduce time by sacrificing space and vice versa (usually space/time changes are by a constant factor)
  22. 22Disk-based Space/Time TradeoffDisk operations (reads and writes are expensive compared to RAM) usually, the smaller you make the disk storage requirements the faster your program will run
  23. 23recurrence (or recurrence relation)an equation or inequality that describes a function in terms of its value on smaller inputs
  24. 24Setstore a group of non-duplicate elements
  25. 25Liststore an ordered* collection of elements
  26. 26Stackstore objects, process them LIFO
  27. 27Queuestore objects, process them FIFO
  28. 28Priority Queuestore objects, process them in order of priorities

Information

Description
Flashcards on Exam 1, created by Siah Thomas on 14/06/2023.
Created by
Siah Thomas
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?