Edited, memorised or added to reading queue

on 23-Oct-2018 (Tue)

Do you want BuboFlash to help you learning these things? Click here to log in or create user.

Flashcard 3442072227084

Question
In linux, regular expression [...] , marked via the enclosing escaped-round-bracket syntax, group parts of a regular expression together, so they can be swapped or just displayed in chuncks via sed, for example.
Answer
subexpressions

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
8. Streams and sed -- The Stream Editor
g text around within lines. Consider, for example, the output of ls : say you want to automatically strip out only the size column-- sed can do this sort of editing if you use the special \( \) <span>notation to group parts of the regular expression together. Consider the following example: sed -e 's/\(<[^ ]*>\)\([ ]*\)\(<[^ ]*>\)/\3\2\1/g' Here sed is searching for the expression \<.*\>[ ]*\<.*\> . From the chapter







Flashcard 3497609792780

Question
In python/algorithms, what is the time complexity of index lookup/assignment for lists (e.g. you have l = [1,2,3,4,5], what is big-O of doing: l[2] = 0)?
Answer
O(1)
^^ the reason it is O(1), is because doing delete via pop(i) is O(n) as a python tradeoff to make index assignment faster.

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3497613724940

Question
In python/algorithms, what is the time complexity of append for lists (e.g. you have l = [1,2,3,4,5], what is big-O of doing: l.append(6))?
Answer
O(1)

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3497617657100

Question
In python/algorithms, what is the time complexity of pop() for lists (e.g. you have l = [1,2,3,4,5], what is big-O of doing: l.pop()?
Answer
O(1)

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3497621589260

Question
In python/algorithms, what is the time complexity of pop(i) for lists (e.g. you have l = [1,2,3,4,5], what is big-O of doing: l.pop(0)?
Answer
O(n)
^^ this is python sacrifice to make index assignment O(1)

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3497625521420

Question
In python/algorithms, what is the time complexity of insert(i,item) for lists (e.g. you have l = [1,2,3,4,5], what is big-O of doing: l.insert(1,7)?
Answer
O(n)

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3497629453580

Question
In python/algorithms, what is the time complexity of concatination for lists, where original list length is n, and the length of list being concatinated is k?
Answer
O(k)

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs