MCPcopy Create free account
hub / github.com/careercup/ctci / addToQueue

Method addToQueue

python/Chapter 1/Question1_4/ChapQ1.4.py:11–15  ·  view source on GitHub ↗
(self,char)

Source from the content-addressed store, hash-verified

9 self.queuelength = 0
10
11 def addToQueue(self,char):
12 #find first open space from end and add the char
13 backindex=(len(self.instring)-1)-self.queuelength
14 self.instring[backindex]=char
15 self.queuelength += 1
16
17 def getFromQueue(self):
18 #pop the queue

Callers 1

changeSpacesForURLFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected