WEEK 2: INTRO TO DSA Flashcards
(44 cards)
a computational method for solving a problem; a sequence of steps that take us from the input to the output
algorithm
an algorithm must be (4):
correct, finite, general, efficicent
an algoritm should provide correct solution according to the specifications
correct
an algorithm should terminate
finite
an algorithm should work for every instance of a problem
general
an algorithm should use few resources (such as time and memory)
efficient
2 types of algorithm representation
flowchart & pseudocode
a graphical representation of an algorithm
flowchart
an english-like representation of the code required for an algorithm; it is the most common tool to define alogithms
pseudocode
the first programming concept
nonstructured, linear programs (spaghetti code)
in this programming concept, the logic flow wounds through the program; all processes are stored in main
nonstructured, linear programs
the second concept of programming
modular programminbng (structured/procedural)
programs were organized in functions, each of which is still used in a linear coding technique
modular programming
the third and modern programming concept
object-oriented programming
in this programming concept, the functions are developed around an object; one part of it is encapsulation, in which all processing from an object is bundled together in a library and hidden from the user
object-oriented programming
3 types of statement constructs in programming
sequence, selection, loop
a series of statements that do not alter the execution path within an algorithm
sequence
this evaluates one or more alternative; also known as conditional statements
selection
iterates a block of code
loop
main difference between array & data structure
array is homogeneous while data structure is not
array concept; you declare one data type to be used for the entire structure
homogeneous
a way of organizing data considering not only the items stored, but also their relationship from each other
data structure
an aggregation of atomic and composite data types into a set with defined relationships
data structure
a combination of elements each of which is either a data type or another one of itself
data structure