¡GoConqr estrena diseño! Cuéntanos qué te parece.

Fichas

CE204

B O U Y B O Y Inglés 26 fichas

CE204

Fichas del conjunto (26)

  1. 1Quicksort• Recursive
    • The pivot is in the correct position when left items are smaller and right items are bigger
    • make middle item pivot
    • left pointer takes first smaller item
    • right pivot takes first larger item
    • swap larger and smaller items
    • when pointer meet swap pivot with middle item
    • sort sublists same way
  2. 2Mergesort• Divide and conquer
    • Recursive
    • Easy-split hard-merge
    • O(nlogn)
    • Break array down into single variables
    • Compare the individual values in pairs
    • Create new temparrays to store the sorted values
    • Continue to compare temp arrays until a sorted array is created
  3. 3Insertion sort• Easy-split hard-merge
    • Linear
    • O(n^2)
    • Work from left to right
    • Examine each item and compare it to items on its left
    • Insert item into the correct position
    • Mark first item as sorted
    • Compare next item to item before
    • If smaller swap items
    • Keep comparing to items before until there are no lower values before
    • Move to next item
  4. 4Selection sort• Hard-split easy-merge
    • Iterative
    • O(n^2)
    • Select the smallest item from the unsorted partition
    • Move it to the sorted partition
    • Start at first value
    • Progress through array until the smallest value is found
    • If a smaller value is found, swap that with the current value
    • Move to net value
  5. 5Primm's Algorithm• Greedy
    • Cannot add vertices that are already in MCST
    • Create empty list "visited"
    • Pick a node to start from
    • Add that node to visited list
    • Choose next cheapest path to unvisited node and add to list
    • Continue to add cheapest paths stemming from visited nodes
    • Add edge weights to get MCST's total weight
    • {A}, {B, E}, {C}, {D} Add BE to MCST
    • {A, D}, {B, E}, {C} Add AD to MCST
    • Final MCST: BE, AD, DE, AC
  6. 6Kruskal's algorithm• Acyclical
    Pick smallest edge to start
    • Add edges that don't create a cycle
    • Continue to add smallest edges
    • Don't connect 2 nodes that are in the same tree
  7. 7Loop, for, if etc. time complexity• O(n)
    • n being number of times occuring
  8. 8Non-computable function• A function that can be specified precisely but cannot be implemented using a programming language
    • An example is the halting problem
  9. 9Halting Problem• Non-computable
    • Whether a program will terminate when run with specific data
    • Supplied string 'p' containing program source and data 'd'
    • Can the 'p' terminate when run with 'd'
    • Function 'h' can tell us if a program halts with given input
    • Program 'h+' should run 'p' with 'd' using 'h'.
    • 'h+' should halt the problem if 'h' says it will run indefinitely
    • 'h+' should run indefinitely if 'h' says the problem should halt
    • Uses proof by contradiction
    • The program cannot return the correct results in all cases
    • Proves that there cannot be a general algorithm that states if every program will halt or not
  10. 10Adjacency MatrixA two-dimensional array a[u][v] will have the value of true if edge a[u][v] exists
  11. 11Adjacency List• A list of the adjacencies in a graph
    • A: (C,3) (D,2) (B,5)
  12. 12Big O statementBig O statement
  13. 13Balancedfor every non-leaf node the size of its left and right children differs by at most one
  14. 14AVL-balancedfor every non-leaf node the depth of its left and right children differs by at most one
  15. 15Binary Tree (Return post order)Binary Tree (Return post order)
  16. 16Stack ClassStack Class
  17. 17Stack isemptyStack isempty
  18. 18Stack TopStack Top
  19. 19Stack popStack pop
  20. 20Stack pushStack push
  21. 21Queue ClassQueue Class
  22. 22Queue isemptyQueue isempty
  23. 23Queue addQueue add
  24. 24Queue FrontQueue Front
  25. 25Queue Remove frontQueue Remove front
  26. 26King JouisKing Jouis

Información

Descripción
Fichas sobre CE204, creado por B O U Y B O Y el 14/05/2019.
Creado por
B O U Y B O Y
Visitas
12
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?