Finding the index of an element to be inserted in a sorted listGiven an ordered set S, find the points in S corresponding to another listFinding all elements within a certain range in a sorted listFinding an index with certain conditionsFinding duplicates in a listFinding the index of (x,y) pairs in a listClean and handy Options management/filteringEasiest/most efficient way to delete duplicates from one list at the positions of another?Corresponding list value and index in a listHow to use the value returned from Position as index for another list?Inserting an integer into a sorted listFinding the index of a specific element in a list
What does the hyphen "-" mean in "tar xzf -"?
Parameterize chained calls to a utility program in Bash
Can White Castle?
Improving triangulation on AutoCAD-generated stl files
What is the origin of Scooby-Doo's name?
Drawing people along with x and y axis
Employer wants to use my work email account after I quit
Explain why a line can never intersect a plane in exactly two points.
Do I have any obligations to my PhD supervisor's requests after I have graduated?
Unusual mail headers, evidence of an attempted attack. Have I been pwned?
How to find the last non zero element in every column throughout dataframe?
When two first person POV characters meet
Why do all the teams that I have worked with always finish a sprint without completion of all the stories?
Is it illegal to withhold someone's passport and green card in California?
What can I do with a research project that is my university’s intellectual property?
LWC - Best practice for routing?
Why do even high-end cameras often still include normal (non-cross-type) AF sensors?
Output of "$OSTYPE:6" on old releases of Mac OS X
How to make clear to people I don't want to answer their "Where are you from?" question?
Would it be a copyright violation if I made a character’s full name refer to a song?
How to model a twisted cylinder like this
How is hair tissue mineral analysis performed?
Are all instances of trolls turning to stone ultimately references back to Tolkien?
How to remove this component from PCB
Finding the index of an element to be inserted in a sorted list
Given an ordered set S, find the points in S corresponding to another listFinding all elements within a certain range in a sorted listFinding an index with certain conditionsFinding duplicates in a listFinding the index of (x,y) pairs in a listClean and handy Options management/filteringEasiest/most efficient way to delete duplicates from one list at the positions of another?Corresponding list value and index in a listHow to use the value returned from Position as index for another list?Inserting an integer into a sorted listFinding the index of a specific element in a list
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I have a sorted list with no duplicates:
L = 1, 2, 5, 7, 8
Given an integer n
, I want to find the index of n
if it is to be inserted into L
.
I have been using
Length[Select[L, # <= n &]]
But that is incredibly unoptimal as I should be able to do this in $log n$ by bisecting the set. How should I approach this?
list-manipulation function-construction
New contributor
$endgroup$
add a comment |
$begingroup$
I have a sorted list with no duplicates:
L = 1, 2, 5, 7, 8
Given an integer n
, I want to find the index of n
if it is to be inserted into L
.
I have been using
Length[Select[L, # <= n &]]
But that is incredibly unoptimal as I should be able to do this in $log n$ by bisecting the set. How should I approach this?
list-manipulation function-construction
New contributor
$endgroup$
add a comment |
$begingroup$
I have a sorted list with no duplicates:
L = 1, 2, 5, 7, 8
Given an integer n
, I want to find the index of n
if it is to be inserted into L
.
I have been using
Length[Select[L, # <= n &]]
But that is incredibly unoptimal as I should be able to do this in $log n$ by bisecting the set. How should I approach this?
list-manipulation function-construction
New contributor
$endgroup$
I have a sorted list with no duplicates:
L = 1, 2, 5, 7, 8
Given an integer n
, I want to find the index of n
if it is to be inserted into L
.
I have been using
Length[Select[L, # <= n &]]
But that is incredibly unoptimal as I should be able to do this in $log n$ by bisecting the set. How should I approach this?
list-manipulation function-construction
list-manipulation function-construction
New contributor
New contributor
edited Jun 13 at 3:34
David G. Stork
25.6k22256
25.6k22256
New contributor
asked Jun 13 at 2:45
user66097user66097
241
241
New contributor
New contributor
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
ClearAll[pos0, pos1, pos2, pos3]
pos0[l_, n_] := Total@UnitStep[n - l]
pos1[l_, n_] := LengthWhile[l, # < n &]
pos2[l_, n_] := Ordering[Ordering[Join[n, l]]][[1]]
pos3[l_, n_] := If[n <= Length[l]/3, pos1[l, n], pos2[l, n]]
L = 1, 2, 5, 7, 8;
pos0[L,3], pos1[L, 3], pos2[L, 3], pos3[L, 3]
2, 2, 2, 2
$endgroup$
add a comment |
$begingroup$
You could use a variation of my LeftNeighbor function, although it returns the left neighbor strictly less than the number instead of less equal as in your solution:
LeftNeighbor[s_]:=LeftNeighborFunction[s,Nearest[s->"Index"]]
LeftNeighbor[s_,list_List]:=LeftNeighbor[s][list]
LeftNeighbor[s_, elem_]:=First@LeftNeighbor[s][elem]
LeftNeighborFunction[s_,nf_][list_List]:=With[n=nf[list][[All,1]],n-UnitStep[s[[n]]-list]]
LeftNeighborFunction[s_,nf_][elem_]:=First @ LeftNeighborFunction[s,nf][elem]
MakeBoxes[i:LeftNeighborFunction[s_,nf_], StandardForm] ^:= Module[
len=Length[s],
g = FirstCase[ToBoxes[nf], _GraphicsBox, GraphicsBox[Point[0,0]],Infinity]
,
BoxForm`ArrangeSummaryBox[
LeftNeighborFunction,
i,
RawBoxes@g,
BoxForm`MakeSummaryItem["Data points: ",Length[s],StandardForm],
BoxForm`MakeSummaryItem["Range: ",MinMax[s],StandardForm]
,
,
StandardForm,
"Interpretable"->True
]
]
Then:
L=1,2,5,7,8;
lnf = LeftNeighbor[L];
lnf[5]
lnf[Range[0, 9]]
2
0, 0, 1, 2, 2, 2, 3, 3, 4, 5
It should be possible to modify the code to return the left neighbor that is less equal than the requested number if desired.
A remark on performance
The construction of the LeftNeighborFunction
can be slow, but if you want to find the index of many numbers into the same list L
, then you will only have to construct the LeftNeighborFunction
once. Here is a comparison with a large list:
L = Sort @ RandomReal[100, 10^6];
The construction of the LeftNeightbor
is a bit slow:
lnf = LeftNeighbor[L]; //RepeatedTiming
0.052, Null
But finding the index of many numbers is very fast:
sample = RandomReal[100, 10^3];
r1 = lnf[sample]; //RepeatedTiming
0.00020, Null
Compare this with one of kglr's solution:
r2 = pos0[L, #]& /@ sample; //RepeatedTiming
3.05, Null
Check :
r1 === r2
True
$endgroup$
add a comment |
$begingroup$
It seems to me that the issue of how to handle inappropriate inputs is as important finding the position of an integer that is in the list being considered. Therefore, I would write something like this:
positionOfN[data : __Integer, n_Integer] :=
First[First[Position[data, n], Return[$Failed]]]
positionOfN[_, _] = $Failed;
Testing
data = 1, 2, 5, 7, 8;
positionOfN[data, 5]
3
positionOfN[data, -5]
$Failed
positionOfN[data, 5.]
$Failed
positionOfN["foo", "bar", 5]
$Failed
Note
If you don't want $Failed
to be returned as the failure value, substitute whatever value you like for the two occurrences of $Failed
.
$endgroup$
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
user66097 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f200260%2ffinding-the-index-of-an-element-to-be-inserted-in-a-sorted-list%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
ClearAll[pos0, pos1, pos2, pos3]
pos0[l_, n_] := Total@UnitStep[n - l]
pos1[l_, n_] := LengthWhile[l, # < n &]
pos2[l_, n_] := Ordering[Ordering[Join[n, l]]][[1]]
pos3[l_, n_] := If[n <= Length[l]/3, pos1[l, n], pos2[l, n]]
L = 1, 2, 5, 7, 8;
pos0[L,3], pos1[L, 3], pos2[L, 3], pos3[L, 3]
2, 2, 2, 2
$endgroup$
add a comment |
$begingroup$
ClearAll[pos0, pos1, pos2, pos3]
pos0[l_, n_] := Total@UnitStep[n - l]
pos1[l_, n_] := LengthWhile[l, # < n &]
pos2[l_, n_] := Ordering[Ordering[Join[n, l]]][[1]]
pos3[l_, n_] := If[n <= Length[l]/3, pos1[l, n], pos2[l, n]]
L = 1, 2, 5, 7, 8;
pos0[L,3], pos1[L, 3], pos2[L, 3], pos3[L, 3]
2, 2, 2, 2
$endgroup$
add a comment |
$begingroup$
ClearAll[pos0, pos1, pos2, pos3]
pos0[l_, n_] := Total@UnitStep[n - l]
pos1[l_, n_] := LengthWhile[l, # < n &]
pos2[l_, n_] := Ordering[Ordering[Join[n, l]]][[1]]
pos3[l_, n_] := If[n <= Length[l]/3, pos1[l, n], pos2[l, n]]
L = 1, 2, 5, 7, 8;
pos0[L,3], pos1[L, 3], pos2[L, 3], pos3[L, 3]
2, 2, 2, 2
$endgroup$
ClearAll[pos0, pos1, pos2, pos3]
pos0[l_, n_] := Total@UnitStep[n - l]
pos1[l_, n_] := LengthWhile[l, # < n &]
pos2[l_, n_] := Ordering[Ordering[Join[n, l]]][[1]]
pos3[l_, n_] := If[n <= Length[l]/3, pos1[l, n], pos2[l, n]]
L = 1, 2, 5, 7, 8;
pos0[L,3], pos1[L, 3], pos2[L, 3], pos3[L, 3]
2, 2, 2, 2
edited Jun 13 at 3:14
answered Jun 13 at 3:00
kglrkglr
199k10228454
199k10228454
add a comment |
add a comment |
$begingroup$
You could use a variation of my LeftNeighbor function, although it returns the left neighbor strictly less than the number instead of less equal as in your solution:
LeftNeighbor[s_]:=LeftNeighborFunction[s,Nearest[s->"Index"]]
LeftNeighbor[s_,list_List]:=LeftNeighbor[s][list]
LeftNeighbor[s_, elem_]:=First@LeftNeighbor[s][elem]
LeftNeighborFunction[s_,nf_][list_List]:=With[n=nf[list][[All,1]],n-UnitStep[s[[n]]-list]]
LeftNeighborFunction[s_,nf_][elem_]:=First @ LeftNeighborFunction[s,nf][elem]
MakeBoxes[i:LeftNeighborFunction[s_,nf_], StandardForm] ^:= Module[
len=Length[s],
g = FirstCase[ToBoxes[nf], _GraphicsBox, GraphicsBox[Point[0,0]],Infinity]
,
BoxForm`ArrangeSummaryBox[
LeftNeighborFunction,
i,
RawBoxes@g,
BoxForm`MakeSummaryItem["Data points: ",Length[s],StandardForm],
BoxForm`MakeSummaryItem["Range: ",MinMax[s],StandardForm]
,
,
StandardForm,
"Interpretable"->True
]
]
Then:
L=1,2,5,7,8;
lnf = LeftNeighbor[L];
lnf[5]
lnf[Range[0, 9]]
2
0, 0, 1, 2, 2, 2, 3, 3, 4, 5
It should be possible to modify the code to return the left neighbor that is less equal than the requested number if desired.
A remark on performance
The construction of the LeftNeighborFunction
can be slow, but if you want to find the index of many numbers into the same list L
, then you will only have to construct the LeftNeighborFunction
once. Here is a comparison with a large list:
L = Sort @ RandomReal[100, 10^6];
The construction of the LeftNeightbor
is a bit slow:
lnf = LeftNeighbor[L]; //RepeatedTiming
0.052, Null
But finding the index of many numbers is very fast:
sample = RandomReal[100, 10^3];
r1 = lnf[sample]; //RepeatedTiming
0.00020, Null
Compare this with one of kglr's solution:
r2 = pos0[L, #]& /@ sample; //RepeatedTiming
3.05, Null
Check :
r1 === r2
True
$endgroup$
add a comment |
$begingroup$
You could use a variation of my LeftNeighbor function, although it returns the left neighbor strictly less than the number instead of less equal as in your solution:
LeftNeighbor[s_]:=LeftNeighborFunction[s,Nearest[s->"Index"]]
LeftNeighbor[s_,list_List]:=LeftNeighbor[s][list]
LeftNeighbor[s_, elem_]:=First@LeftNeighbor[s][elem]
LeftNeighborFunction[s_,nf_][list_List]:=With[n=nf[list][[All,1]],n-UnitStep[s[[n]]-list]]
LeftNeighborFunction[s_,nf_][elem_]:=First @ LeftNeighborFunction[s,nf][elem]
MakeBoxes[i:LeftNeighborFunction[s_,nf_], StandardForm] ^:= Module[
len=Length[s],
g = FirstCase[ToBoxes[nf], _GraphicsBox, GraphicsBox[Point[0,0]],Infinity]
,
BoxForm`ArrangeSummaryBox[
LeftNeighborFunction,
i,
RawBoxes@g,
BoxForm`MakeSummaryItem["Data points: ",Length[s],StandardForm],
BoxForm`MakeSummaryItem["Range: ",MinMax[s],StandardForm]
,
,
StandardForm,
"Interpretable"->True
]
]
Then:
L=1,2,5,7,8;
lnf = LeftNeighbor[L];
lnf[5]
lnf[Range[0, 9]]
2
0, 0, 1, 2, 2, 2, 3, 3, 4, 5
It should be possible to modify the code to return the left neighbor that is less equal than the requested number if desired.
A remark on performance
The construction of the LeftNeighborFunction
can be slow, but if you want to find the index of many numbers into the same list L
, then you will only have to construct the LeftNeighborFunction
once. Here is a comparison with a large list:
L = Sort @ RandomReal[100, 10^6];
The construction of the LeftNeightbor
is a bit slow:
lnf = LeftNeighbor[L]; //RepeatedTiming
0.052, Null
But finding the index of many numbers is very fast:
sample = RandomReal[100, 10^3];
r1 = lnf[sample]; //RepeatedTiming
0.00020, Null
Compare this with one of kglr's solution:
r2 = pos0[L, #]& /@ sample; //RepeatedTiming
3.05, Null
Check :
r1 === r2
True
$endgroup$
add a comment |
$begingroup$
You could use a variation of my LeftNeighbor function, although it returns the left neighbor strictly less than the number instead of less equal as in your solution:
LeftNeighbor[s_]:=LeftNeighborFunction[s,Nearest[s->"Index"]]
LeftNeighbor[s_,list_List]:=LeftNeighbor[s][list]
LeftNeighbor[s_, elem_]:=First@LeftNeighbor[s][elem]
LeftNeighborFunction[s_,nf_][list_List]:=With[n=nf[list][[All,1]],n-UnitStep[s[[n]]-list]]
LeftNeighborFunction[s_,nf_][elem_]:=First @ LeftNeighborFunction[s,nf][elem]
MakeBoxes[i:LeftNeighborFunction[s_,nf_], StandardForm] ^:= Module[
len=Length[s],
g = FirstCase[ToBoxes[nf], _GraphicsBox, GraphicsBox[Point[0,0]],Infinity]
,
BoxForm`ArrangeSummaryBox[
LeftNeighborFunction,
i,
RawBoxes@g,
BoxForm`MakeSummaryItem["Data points: ",Length[s],StandardForm],
BoxForm`MakeSummaryItem["Range: ",MinMax[s],StandardForm]
,
,
StandardForm,
"Interpretable"->True
]
]
Then:
L=1,2,5,7,8;
lnf = LeftNeighbor[L];
lnf[5]
lnf[Range[0, 9]]
2
0, 0, 1, 2, 2, 2, 3, 3, 4, 5
It should be possible to modify the code to return the left neighbor that is less equal than the requested number if desired.
A remark on performance
The construction of the LeftNeighborFunction
can be slow, but if you want to find the index of many numbers into the same list L
, then you will only have to construct the LeftNeighborFunction
once. Here is a comparison with a large list:
L = Sort @ RandomReal[100, 10^6];
The construction of the LeftNeightbor
is a bit slow:
lnf = LeftNeighbor[L]; //RepeatedTiming
0.052, Null
But finding the index of many numbers is very fast:
sample = RandomReal[100, 10^3];
r1 = lnf[sample]; //RepeatedTiming
0.00020, Null
Compare this with one of kglr's solution:
r2 = pos0[L, #]& /@ sample; //RepeatedTiming
3.05, Null
Check :
r1 === r2
True
$endgroup$
You could use a variation of my LeftNeighbor function, although it returns the left neighbor strictly less than the number instead of less equal as in your solution:
LeftNeighbor[s_]:=LeftNeighborFunction[s,Nearest[s->"Index"]]
LeftNeighbor[s_,list_List]:=LeftNeighbor[s][list]
LeftNeighbor[s_, elem_]:=First@LeftNeighbor[s][elem]
LeftNeighborFunction[s_,nf_][list_List]:=With[n=nf[list][[All,1]],n-UnitStep[s[[n]]-list]]
LeftNeighborFunction[s_,nf_][elem_]:=First @ LeftNeighborFunction[s,nf][elem]
MakeBoxes[i:LeftNeighborFunction[s_,nf_], StandardForm] ^:= Module[
len=Length[s],
g = FirstCase[ToBoxes[nf], _GraphicsBox, GraphicsBox[Point[0,0]],Infinity]
,
BoxForm`ArrangeSummaryBox[
LeftNeighborFunction,
i,
RawBoxes@g,
BoxForm`MakeSummaryItem["Data points: ",Length[s],StandardForm],
BoxForm`MakeSummaryItem["Range: ",MinMax[s],StandardForm]
,
,
StandardForm,
"Interpretable"->True
]
]
Then:
L=1,2,5,7,8;
lnf = LeftNeighbor[L];
lnf[5]
lnf[Range[0, 9]]
2
0, 0, 1, 2, 2, 2, 3, 3, 4, 5
It should be possible to modify the code to return the left neighbor that is less equal than the requested number if desired.
A remark on performance
The construction of the LeftNeighborFunction
can be slow, but if you want to find the index of many numbers into the same list L
, then you will only have to construct the LeftNeighborFunction
once. Here is a comparison with a large list:
L = Sort @ RandomReal[100, 10^6];
The construction of the LeftNeightbor
is a bit slow:
lnf = LeftNeighbor[L]; //RepeatedTiming
0.052, Null
But finding the index of many numbers is very fast:
sample = RandomReal[100, 10^3];
r1 = lnf[sample]; //RepeatedTiming
0.00020, Null
Compare this with one of kglr's solution:
r2 = pos0[L, #]& /@ sample; //RepeatedTiming
3.05, Null
Check :
r1 === r2
True
edited Jun 13 at 3:32
answered Jun 13 at 3:20
Carl WollCarl Woll
84.8k3109220
84.8k3109220
add a comment |
add a comment |
$begingroup$
It seems to me that the issue of how to handle inappropriate inputs is as important finding the position of an integer that is in the list being considered. Therefore, I would write something like this:
positionOfN[data : __Integer, n_Integer] :=
First[First[Position[data, n], Return[$Failed]]]
positionOfN[_, _] = $Failed;
Testing
data = 1, 2, 5, 7, 8;
positionOfN[data, 5]
3
positionOfN[data, -5]
$Failed
positionOfN[data, 5.]
$Failed
positionOfN["foo", "bar", 5]
$Failed
Note
If you don't want $Failed
to be returned as the failure value, substitute whatever value you like for the two occurrences of $Failed
.
$endgroup$
add a comment |
$begingroup$
It seems to me that the issue of how to handle inappropriate inputs is as important finding the position of an integer that is in the list being considered. Therefore, I would write something like this:
positionOfN[data : __Integer, n_Integer] :=
First[First[Position[data, n], Return[$Failed]]]
positionOfN[_, _] = $Failed;
Testing
data = 1, 2, 5, 7, 8;
positionOfN[data, 5]
3
positionOfN[data, -5]
$Failed
positionOfN[data, 5.]
$Failed
positionOfN["foo", "bar", 5]
$Failed
Note
If you don't want $Failed
to be returned as the failure value, substitute whatever value you like for the two occurrences of $Failed
.
$endgroup$
add a comment |
$begingroup$
It seems to me that the issue of how to handle inappropriate inputs is as important finding the position of an integer that is in the list being considered. Therefore, I would write something like this:
positionOfN[data : __Integer, n_Integer] :=
First[First[Position[data, n], Return[$Failed]]]
positionOfN[_, _] = $Failed;
Testing
data = 1, 2, 5, 7, 8;
positionOfN[data, 5]
3
positionOfN[data, -5]
$Failed
positionOfN[data, 5.]
$Failed
positionOfN["foo", "bar", 5]
$Failed
Note
If you don't want $Failed
to be returned as the failure value, substitute whatever value you like for the two occurrences of $Failed
.
$endgroup$
It seems to me that the issue of how to handle inappropriate inputs is as important finding the position of an integer that is in the list being considered. Therefore, I would write something like this:
positionOfN[data : __Integer, n_Integer] :=
First[First[Position[data, n], Return[$Failed]]]
positionOfN[_, _] = $Failed;
Testing
data = 1, 2, 5, 7, 8;
positionOfN[data, 5]
3
positionOfN[data, -5]
$Failed
positionOfN[data, 5.]
$Failed
positionOfN["foo", "bar", 5]
$Failed
Note
If you don't want $Failed
to be returned as the failure value, substitute whatever value you like for the two occurrences of $Failed
.
answered Jun 13 at 3:29
m_goldbergm_goldberg
90.6k875203
90.6k875203
add a comment |
add a comment |
user66097 is a new contributor. Be nice, and check out our Code of Conduct.
user66097 is a new contributor. Be nice, and check out our Code of Conduct.
user66097 is a new contributor. Be nice, and check out our Code of Conduct.
user66097 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f200260%2ffinding-the-index-of-an-element-to-be-inserted-in-a-sorted-list%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown