Python

Ace your homework & exams now with Quizwiz!

Big O notation Ascending order of complexity

O(1), O(log n), O(n), O(n log n), O(n^2), O(n^3), O(2^n), O(n!)

Binary Search Time Complexity

O(log n)

Time needed to search a sorted list with binary search?

O(log n)

efficiency of merge sort

O(n log n)

Big O notation with the worst time complexity?

O(n!)

Big O notation for adding new item in front of list?

O(n)

Linear Search Time Complexity

O(n)

List time complexity

O(n)

Queue time complexity

O(n)

Searching for an element in linked list time complexity

O(n)

Efficiency of Bubble Sort

O(n^2)

Efficiency of Insertion Sort

O(n^2)

efficiency of selection sort

O(n^2)

What is the set recursion depth by default and can we modify it?

1000, can be modified irrespective of system

Big O notation calculates the time of execution of an algorithm

False

O(n) is better as compared to O(log n) in terms of time complexity

False

What principle does a Stack data structure use

LIFO

Big O notation for inserting item in back of list?

O(1)

Linked list time complexity

O(1)

Searching for an element in list

O(1)

Stack Time Complexity

O(1)

Using big O notation, what indicates a constant time complexity?

O(1)

What is the error given by the system when the recursion limit is exceeded?

Recursion Error

What is stored in a "file handle" that is returned from a successful open() call?

The handle is a connection to the file's data

Big O notation indicates the efficiency of algorithms when the input size is big

True

Merge sort has a better time complexity compared to bubble sort

True

Normally, worst case situation is used to estimate the big O notation

True

What do we use the second parameter of the open() call to indicate?

Whether we want to read data from the file or write data to the file

Which python function to prompt user for a filename to open?

input()

Where are files stored?

secondary memory

Recursion calls are stored on the memory in which data structure?

stack


Related study sets

Chapter 11: Fundamentals of the Nervous System

View Set

ACC 617 exam 3 CH 11 Auditing & Corporate Governance: An International Perspective

View Set

Ch. 4 Information Security Controls

View Set