Tutor profile: Priyanka A.
Subject: Python Programming
What are the major differences between a tuple and a list in python?
A list is mutable i.e. it can be modified once created. Elements can be added or replaced in a list. But a tuple is immutable and it tends to remain the same once created. Hence elements cannot be added or replaced in a tuple. Because of the above reason processing of tuples is said to be faster than list processing.
Subject: Discrete Math
Why is Konigsberg Bridge problem not solvable?
For crossing all the bridges at once without repetition the Konigsberg Bridge graph has to be either Eulerian or traversable. Now a graph is traversable if it is connected and has exactly two vertices of odd degree. A graph is eulerian if it is connected and all has all vertices of even degree. But, konigsberg Bridge graph has all vertices of odd degree. So, it is neither Eulerian nor traversable and hence the problem is not solvable.
Subject: C++ Programming
One of the advantages of merge sort over quick sort is that merge sort is stable while quick sort is an unstable sorting algorithm. Why is it necessary to have stable sorting algorithms?
It is necessary to have stable sorting algorithms because when sorting is done based on one of the attributes of large databases, it remains sorted according to this particular attribute even if sorting is done again based on some other attribute. For example if the database of employees in some organisation is sorted according to their names. Now if stable sorting is done based on their salary, the entries still remain sorted according to names. This is not possible with unstable sorting algorithms and the relative order of entries is disturbed. So, having stable sorting algorithms is always an advantage.
needs and Priyanka will reply soon.