How to get the second largest number by not usings list and max()min()
<p>I want to find the second largest number such as this topic. <a href="http://stackoverflow.com/questions/16225677/get-the-second-largest-number-in-a-list-in-linear-time">Get the second largest number in a list in linear time</a></p>

<p>My problem is this restricting words <code>list</code>, <code>[]</code>, <code>remove</code>, <code>del</code>, <code>min</code>, <code>max</code>, <code>dict</code>, <code>{}</code>, <code>sort</code>, <code>pop</code>.</p>

<p>I have no ideas to get the second largest number. Then, I want someone to suggest me.</p>

<p>Thanks!</p>

<pre><code>first_max=arr[0]
second_max=first_max
if(arr[0]&gt;arr[1]):
    first_max=arr[0]
    second_max=arr[1]
for i in range(1,len(arr)):
    if(arr[i]&gt;first_max):
       second_max=first_max
       first_max=arr[i]
    elif(arr[i]&gt;second_max):
       second_max=arr[i]

print(second_max)
</code></pre>

<p>I think above code will work for all cases... try and let me know.</p>

python