Algorithms and data stricture

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/40

encourage image

There's no tags or description

Looks like no tags are added yet.

41 Terms

1
New cards

What is the Big O of binary search

O(log n)

2
New cards

What is the big O of bubble sort

O(n2)

3
New cards

What is the big O of merge sort

O(n log n))

4
New cards

What is the big O of quick sorting

O(N log N

5
New cards

What is the big O of a single loop

O(N)

6
New cards

What is the big O of two nested loops

O(N2)

7
New cards

What is the big O of three nested loops

O(N3)

8
New cards

What is profiling

Measuring where a program spends its running time to identify performance problems

9
New cards

What is cProfile

Pythons built-in tool for measuring function calls and execution times

10
New cards

What is the correct profiling approach

Find the problem, fix it, then check whether performance improved

11
New cards

runtime concentration

A small proportion of functions can account for most programs running time

12
New cards

What is ncalls

The number of times a function was called

13
New cards

What is tottime

The time spent executing the function itself, excluding child functions

14
New cards

What is percall

The average time taking by one function call

15
New cards

What is cumtime

The total time of a function, including time spent in child functions

16
New cards

What is call frequency

How often a function runs; even a fast function may become costly when called millions of times

17
New cards

What is big O

A measure of how an algorithms resource use grows as input size growsn

18
New cards

What is HashMap

A data structure that stores key-value pairs for fast lookup

19
New cards

What is a dictionary

Python’s implementation of a hash map using key-value pairs

20
New cards

What is hashing

The process of converting data into a numerical hash value to locate it quickly

21
New cards

What is collision in HashMaps

The situation in which different values map to the same hash-table location

22
New cards

What is dictionary operations

Access, add, update and delete entries using their keys

23
New cards

What is constant time lookup

O(1), access time remain broadly constant as data grows

24
New cards

What is a set

An unordered collection of unique values with no duplicates

25
New cards

What is union

The operation | that returns every element found in either set

26
New cards

Intersection

The operation “&” that returns only elements common to both sets

27
New cards

Difference

The operation “-“ that returns elements present only in the first set

28
New cards

Stack

A last in first out structure used for matching tags, undo operations and backtracking through maze choices

29
New cards

Queue

A first in first out structure in which the earliest item added is the first item removed

30
New cards
31
New cards

Demerging

Partitioning one input queue into separate queues while preserving the original order within each group

32
New cards

Binary tree

A hierarchical structure whose nodes have at most one left child and one right child

33
New cards

Binary search tree

A binary tree where smaller values are placed in the left subtree and larger values in the right subtree

34
New cards

Tree traversal

A systematic method for visiting every tree node in a chosen order, such as in-order, pre order or post order

35
New cards

Balanced tree

A tree whose height remains sufficiently small so searching, insertion and deletion can take logarithmic time

36
New cards

Min heap

A complete binary tree stored commonly in an array with the smallest element at the root

37
New cards

Heapq

Pythons built-in module for maintaining heaps, including efficient insertion and removal of the smallest item

38
New cards
39
New cards
40
New cards
41
New cards