1/30
Flashcards about CPSC101 Test 1
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What invention replaced vacuum tubes and made computers smaller and faster?
Transistor
What is the sequence of the software used to transform source code to machine code?
Preprocessor, compiler, assembler, linker
Who created 'The Analytical Engine,' a machine that led to the creation of computers?
Charles Babbage
Who created the first computer program?
Ada Lovelace
What software is used first when you turn on your computer?
basic input output system
What is the fifth generation of computer science characterized by developing?
Mobile devices and supercomputers
What are the function of operating system?
Memory management, security to protect user data
What are the types of application software?
Editing spreadsheet, spelling check
List the speed of the following devices from slowest to fastest
DVD, RAM, Cache, registers
What are the input and output of the compiler?
High level code, Assembly code
What are the fastest high-performance computers?
Supercomputers
What are some examples of Volatile memories?
Dynamic RAM, Cache, registers
What is the output of the following pseudo code? Count is a number = 250 while (Count > 0) show Count %5 divide Count by 5
0 0 0 2
What is BigO of the problem? Count is a number = 250 while (Count > 0) show Count %5 divide Count by 5
logn
What is the output of the following pseudo code? S=[10,2,3,60,1,78,-12, 55 ], len=length of S, i=0, j=0 while i< len while j < len -i if S[j] > S[j+1] # notice the condition swap S[j], S[j+1] increment j by 1 increment i by 1 print the list
-12, 1,2, 3, 10, 55, 60, 78
What is BigO of the following pseudo code? S=[10,2,3,60,1,78,-12, 55 ], len=length of S, i=0, j=0 while i< len while j < len -i if S[j] > S[j+1] # notice the condition swap S[j], S[j+1] increment j by 1 increment i by 1 print the list
O(n^2)
What is the output of the following pseudo code? Define number n Set n= 10034 total=0 While n > 0 print n%10 add n to total n= integer (n/10) Print total
4 3 0 0 1
What is the total of the following pseudo code? Define number n Set n= 10034 total=0 While n > 0 print n%10 add n to total n= integer (n/10) Print total
11148
What is BigO of the following pseudo code? Define number n Set n= 10034 total=0 While n > 0 print n%10 add n to total n= integer (n/10) Print total
O(logn)
What is the output from the following pseudo code? Define numbers n1 and n2 Set n1=n2=2 While n1< 5 While n2< 4 print n1, n2 Increment n2 by one Increment n1 by one n2=2
2 2 2 3 3 2 3 3 4 2 4 3
What is the BigO from the following pseudo code? Define numbers n1 and n2 Set n1=n2=2 While n1< 5 While n2< 4 print n1, n2 Increment n2 by one Increment n1 by one n2=2
O(n^2)
What is the output of the following pseudo code? Set n= 7 While n < 15 Increment n Print n
9 11 13 15
What is the BigO of the following pseudo code? Set n= 7 While n < 15 Increment n Print n
O( n)
What is the output of the following pseudo code? def linearsearch(arr, x): for i in range(len(arr)): if (arr[i]==x): return i return -1 # Testing list=[6 ,7,100,400,500] print(linearsearch(list, 100))
2
What is the BigO of the following pseudo code? def linearsearch(arr, x): for i in range(len(arr)): if (arr[i]==x): return i return -1 # Testing list=[6 ,7,100,400,500] print(linearsearch(list, 100))
O(n)
Use binary search in the following List of numbers={90, 85, 80, 75, 65, 60, 55, 52, 10, 6} to search for 6. What is the time of the algorithm?
Log(n), 4 rows
What is output of the following code? i=0 a=[1, 23,55,78,3,15,98] while i in range(len(a)): if(a[i] %5 == 0): print(a[i] ,end= ', ‘) i=i+1
55 , 15
What is the output of the following code? v = [1, 2,4, -6, -9, 10,11] a=[3*x for x in v if x > 3] print(a)
[ 12, 30, 33]
What is the output of the following code? v1= [2,4,6 ], v2 = [2,3,4] a=[ v1[i]*v2[i] for i in range(len (v1))] print (a)
[4, 12, 24]
What is the output of the following code? list=[10, 11, 23, -10, 100, 90] a= b= list[0] i=1 while i
100 , -10, 4, 3
What is the output of the following code? number = 25 bin =binary(number) print(bin)
11001