Analysis of Algorithms

The term "analysis of algorithms" was coined by Donald Knuth. "Algorithm analysis is an important part of computational complexity theory, which provides theoretical estimation for the required resources of an algorithm to solve a specific computational problem." So, Analysis of algorithms is the determination of the amount of time and space resources required to execute it. The efficiency of an algorithm is presented as a function related to the length of input to the number of steps (comparisons), known as time complexity, or volume of memory (memory size), known as space complexity.
"एनालिसिस ऑफ़ अल्गोरिथम" पद डोनाल्ड क्नुथ द्वारा गढ़ा गया था। कम्प्यूटेशनल कॉम्प्लेक्सिटी थ्योरी में अल्गोरिथम एनालिसिस एक महत्वपूर्ण भाग है जो एक अल्गोरिथम द्वारा चाहे गए संसाधनों का सैद्धांतिक अनुमान प्रदान करता है, जिससे वह किसी विशिष्ट कम्प्यूटेशनल समस्या को हल कर सके। अतः किसी अल्गोरिथम को रन करने के लिए कितने समय एवं मेमोरी स्पेस की आवश्यकता होगी, यह जानना ही एनालिसिस ऑफ़ अल्गोरिथम कहलाता है। किसी अल्गोरिथम की दक्षता को एक फंक्शन द्वारा प्रदर्शित किया जाता है जो कि इनपुट की लम्बाई एवं चरणों की संख्या से सम्बंधित होता है। इसे टाइम कॉम्प्लेक्सिटीकहा जाता है। या यह मेमोरी के साइज़ से सम्बंधित होता है जिसे स्पेस कॉम्प्लेक्सिटी कहा जाता है।
Worst-case − if an algorithm is executed in its unfavorable condition then it is called in worst case.
Ex:- In linear search, to find an item which exist at last position or absent in the list.
To apply bubble sort on a list which is already sorted in descending order.
यदि अल्गोरिथम को उसकी प्रतिकूल परिस्थिति में एक्सीक्यूट किया जाता है तब इसे वर्स्ट केस कहा जाता है। 
उदाहरण:- लीनियर सर्च में एक आइटम, लिस्ट में खोजना जो लास्ट पोजीशन पर हो या लिस्ट में ना हो। 
बबल सॉर्ट में एक ऐसी लिस्ट को बढ़ते क्रम में व्यवस्थित करना, जो पहले से घटते हुए क्रम में व्यवस्थित हो।
Best-case − if an algorithm is executed in its favorable condition(ideal state) then it is called in best case.
Ex:- In linear search, to find an item which exist at first position in the list.
To apply bubble sort on a list which is already sorted in ascending order.
यदि अल्गोरिथम को उसकी अनुकूल परिस्थिति में एक्सीक्यूट किया जाता है तब इसे बेस्ट केस कहा जाता है। 
उदाहरण:- लीनियर सर्च में एक आइटम, लिस्ट में खोजना जो फर्स्ट पोजीशन पर हो। 
बबल सॉर्ट में एक ऐसी लिस्ट को बढ़ते क्रम में व्यवस्थित करना, जो पहले से बढ़ते हुए क्रम में व्यवस्थित हो।
Average case − if an algorithm is executed in its common condition(general state) then it is called in average case.
Ex:- In linear search, to find an item which exist from 2nd to (N-1) position in the list.
To apply bubble sort on a list which is in random order.
यदि अल्गोरिथम को उसकी सामान्य परिस्थिति में एक्सीक्यूट किया जाता है तब इसे एवरेज केस कहा जाता है। 
उदाहरण:- लीनियर सर्च में एक आइटम, लिस्ट में खोजना जो दूसरी से N-1 वी पोजीशन पर हो। 
बबल सॉर्ट में एक ऐसी लिस्ट को बढ़ते क्रम में व्यवस्थित करना, जो यादृच्छिक रूप से व्यवस्थित हो।
programmer must need to consider time as well as space complexity as the program may run on a system where memory is limited but adequate space is available or may be vice-versa.
प्रोग्रामर को अल्गोरिथम रन करते समय, टाइम एवं स्पेस दोनों जटिलताओ का ध्यान रखना होता है क्यूंकि कभी सिस्टम में मेमोरी स्पेस ज्यादा होगी तब टाइम कम लगेगा या कभी टाइम ज्यादा लगेगा तब सिस्टम में मेमोरी स्पेस कम होगी।

No comments:

Post a Comment

Stack Data Structure, Push, Pop and Peek Operations , Applications of Stack

Stack is a linear data structure. It is collection of ordered data elements. It is also known as LIFO system (last in first out). It means i...