Skip to Main Content
Programming and Data Structures
book

Programming and Data Structures

by Ashok Kamthane
August 2009
Intermediate to advanced content levelIntermediate to advanced
604 pages
21h 39m
English
Pearson India
Content preview from Programming and Data Structures
480 Programming and Data Structures
The va*?ue of m is initially zero. The sum obtained is again subtracted from m. This is because if
negative numbers are entered, they are to be considered in the sorting. For example, the value of
sum=20. In real execution, the sum may be different depending on integers entered.
Value of m would be m= - 20 (as pre m = m - 20 when m = 0).
Thus, in the while loop value of m varies from -20 to 20. In this range, all the entered elements are
covered. The value of m changes from -20 to 20, that is, -20, -19 upto +20 in ascending order. Thus,
the same order is applied while saving elements in array C[].
14.1
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Data Structures and Algorithms

Learning Data Structures and Algorithms

Rod Stephens
Data Structures and Algorithms in C++, Second Edition

Data Structures and Algorithms in C++, Second Edition

Michael T. Goodrich, Roberto Tamassia, David M. Mount

Publisher Resources

ISBN: 9789332506343