Verified Multiple Choice and Conceptual Actual 100% Correct Detailed Answers
Guaranteed Pass!!Current Update!!
radix sort O(nk)
mergesort O(n log(n))
Quicksort O(n^2)
bubble sort O(n^2)
list of important algorithms and their worst case big-O
insertion sort O(n^2)
(just need to memorize)
selection sort O(n^2)
bucket sort O(n^2)
shell sort O(n(log(n))^2)
(pink means good!)
1
log2N
N
big O notations best to worst runtimes Nlog2N
N^2
N^3
2^N
Addition, subtraction, multiplication, and division of fixed
size integer or floating point values.
w = 10.4
x = 3.4
y = 2.0
z = (w - x) / y
Assignment of a reference, pointer, or other fixed size data
value.
x = 1000
y=x
a = true
,WGU C949 Data Structures and Algorithms Frequently Tested Exam Questions With
Verified Multiple Choice and Conceptual Actual 100% Correct Detailed Answers
Guaranteed Pass!!Current Update!!
b=a
Comparison of two fixed size data values.
a = 100
b = 200
if (b > a) {
some constant time operations
...
}
Read or write an array element at a particular index.
x = arr[index]
arr[index + 1] = x + 1
Data types define particular characteristics of data used
in software programs and inform the compilers about
data type
predefined attributes required by specific variables or as-
sociated data objects.
Numbers
String
Python standard data types List
Tuple
Dictionary
A class. A data type that can store data and methods;
An abstract data type (ADT) is a data type described by
predefined user operations, such as "insert data at rear,"
abstract data type without indicating how each operation is implemented.
An ADT can be implemented using ditterent underlying
data structures. However, a programmer need not have
knowledge of the underlying implementation to use an
ADT.
, WGU C949 Data Structures and Algorithms Frequently Tested Exam Questions With
Verified Multiple Choice and Conceptual Actual 100% Correct Detailed Answers
Guaranteed Pass!!Current Update!!
the assignment of memory locations to data
storage allocation
and program code.
abstract data type that represents a countable number of
ordered values, where the same value may occur more
list abstract data type than once.
Removing an item keeps the remaining items in order.xx
The over simplified answer is that arrays contain data
in contiguous space in memory and lists generally store
their information in non-contiguous space. In an array you
know what the next data element is by moving down to
the next element like moving to the house next door on a
street. It's the physical displacement across a standard size
memory boundary that lets you find the next element.
In an "list" each element in the list keeps a "pointer" to the
location of the next element in the list. So in an array you
array vs (linked) list can jump to the 5th element just as you can walk straight
to the fifth house on a street. In a list you'd have to knock
on each house's door and ask inside what the address of
the next house in the group (i.e. list) is. That next house
could be anywhere in the city.
(source: StackOverflow, user mba12)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If a program requires fast insertion of new data, a linked
list is a better choice than an array.
in Python, what is the ditterence between an array and a
list?
, WGU C949 Data Structures and Algorithms Frequently Tested Exam Questions With
Verified Multiple Choice and Conceptual Actual 100% Correct Detailed Answers
Guaranteed Pass!!Current Update!!
Arrays and lists are both used in Python to store data, but
they don't serve exactly the same purposes. They both can
be used to store any data type (real numbers, strings, etc),
and they both can be indexed and iterated through, but
the similarities between the two don't go much further.
The main ditterence between a list and an array is the
functions that you can perform to them. For example, you
can divide an array by 3, and each number in the array
will be divided by 3 and the result will be printed if you
request it. If you try to divide a list by 3, Python will tell you
that it can't be done, and an error will be thrown.
Here's how it would work:
x = array([3, 6, 9, 12])
x/3.0
print(x)
In the above example, your output would be:
array([1, 2, 3, 4])
If you tried to do the same with a list, it would very similar:
y = [3, 6, 9, 12]
y/3.0
print(y)
It's almost exactly like the first example, except you
wouldn't get a valid output because the code would throw
an error.
It does take an extra step to use arrays because they
have to be declared while lists don't because they are
part of Python's syntax, so lists are generally used more
often between the two, which works fine most of the time.
However, if you're going to perform arithmetic functions