Writing Algorithms

Writing Algorithms 

An Algorithm can even be written in Algol (Algorithmic Language) what is very clear and in steps to justify the program objective.

एक एल्गोरिदम भी Algol (Algorithmic Language) में लिखा जा सकता है जो कार्यक्रम के उद्देश्य को सही ठहराने के लिए बहुत स्पष्ट और चरणों में है।

Example 1: Calling a friend on the telephone
टेलीफोन पर एक दोस्त को बुला रहा है
Step 1: Pick up the phone and listen for a dial tone
फोन उठाओ और एक डायल टोन के लिए सुनो
Step 2: Press each digit of the phone number on the phone
फोन नंबर के प्रत्येक अंक को फोन पर दबाएं
Step 3: If busy, hang up phone, wait 5 minutes, jump to step 2
व्यस्त होने पर फोन को हैंग करें, 5 मिनट रुकें, स्टेप 2 पर जाएं
Step 4: If no one answers, leave a message then hang up
यदि कोई जवाब नहीं देता है, तो एक मैसेज छोड़ दें और फिर हैंग अप करें
Step 5: If no answering machine, hang up and wait 2 hours, then jump to step 2
यदि कोई उत्तर देने वाली मशीन नहीं है, तो रुको और 2 घंटे प्रतीक्षा करें, फिर स्टेप 2 पर जाएं
Step 6: Talk to friend
दोस्त से बात करो
Step 7: Hang up phone
फोन को हैंग अप करो
Example 2: Algorithm to Create Maggie Noddle:
मैगी नूडल बनाने के लिए एल्गोरिदमः
Step 1: Startस्टार्ट
Step 2: Take pan with water
पानी के साथ पैन लें
Step 3: Put pan on the burner
पैन को बर्नर पर रखें
Step 4: Switch on the gas/burner
गैस/ बर्नर को स्विच ऑन करें
Step 5: Put Magi and Masala
मैगी और मसाला डालें
Step 6: Give two minutes to boil
उबलने के लिए दो मिनट दें
Step 7: Take off the pan
पैन को उतार लें
Step 8: Take out the magi with the help of fork/spoon
कांटा/चम्मच की मदद से मैगी को बाहर निकालें
Step 9: Put the Maggi on the plate and serve it.
मैगी को प्लेट में रखिये और सर्व कीजिये
Example 3: Here comes an example for adding two numbers.
यहाँ दो संख्याओं को जोड़ने के लिए एक उदाहरण आता है।
Step 1: BEGIN
Step 2: read a, b
Step 3: c=a + b
Step 4: write c
Step 5: END
Example 4: Justifying greater value between two integer numbers.
दो इंटीजर संख्याओं के बीच अधिक से अधिक मूल्य को उचित ठहराना।
Step 1: BEGIN
Step 2: read a, b
Step 3: if (a > b) then write “Greater value is”, a
Step 4: else write “Grater value is “, b
Step 5: END

Advantages of Algorithm – एल्गोरिदम के लाभ

Here we will discuss about advantages of Algorithm
यहां हम एलगोरिदम के फायदों के बारे में चर्चा करेंगे
• It is easy to understand and it facilitates step-by-step solution to a given problem.
यह समझना आसान है और यह किसी समस्या के लिए चरण-दर-चरण समाधान की सुविधा देता है।
• It has got a definite procedure. इसे एक निश्चित प्रक्रिया मिली है।
• It easy to first developer an algorithm, & then converts it into a flow chart & then into a computer program.
पहले एक एल्गोरिदम को विकसित करना आसान है, और फिर इसे एक फ्लो चार्ट में और फिर एक कंप्यूटर प्रोग्राम में परिवर्तित करें।
It is independent of programming language.
यह प्रोग्रामिंग भाषा से स्वतंत्र है
• It is easy to debug as every step is got its own logical sequence.
डिबग करना आसान है क्योंकि हर कदम को अपना तार्किक क्रम मिलता है।

Flowcharts – फ्लोचार्ट

A flowchart is a pictorial representation depicting the flow of steps in a program, people in an organization, or pages in a presentation. In instructional design, flowcharts provide a bird’s-eye view of the structure and sequence of a lesson. Elements are represented by simple icons (circles, rectangles, diamonds or other shapes), with lines and arrows representing connections between events and the direction or order in which they occur. A flowchart indicates sequences and decision points as well as starting and stopping points. Since it is easier to grasp relationships in a visual form than in a verbal description, flowcharts can prevent the omission of steps in a process. Flowcharts are particularly useful for instructional designers who are novice or occasional programmers.

एक फ्लोचार्ट एक चित्रमय प्रतिनिधित्व है जो एक प्रोग्राम में स्टेप्स, एक संगठन में लोगों, या एक प्रस्तुति में पृष्ठों के फ्लो को दर्शाता है। निर्देशात्मक डिजाईन में, फ्लोचार्ट एक टेक्स्ट की संरचना और अनुक्रम के बारे में एक पक्षी की आँख का दृश्य प्रदान करते हैं। एलीमेंट को सरल आइकन (सर्कल, आयताकार, डायमण्ड या अन्य आकृतियों) द्वारा दर्शाया जाता है, घटनाओंऔर दिशा या उस क्रम के बीच कनेक्शन का प्रतिनिधित्व करने वाले लाइनों और तीरों के साथ। एक फ्लोचार्ट दृश्यों और निर्णय बिंदुओं के साथ-साथ अंक को शुरू करने और रोकने का संकेत देता है। चूंकि मौखिक विवरण की अपेक्षा विजुअल रूप में रिश्तों को पकड़ना आसान होता है, फ्लोचार्ट एक प्रक्रिया में चरणों के चूक को रोक सकते हैं। फ्लोचार्ट विशेष रूप से निर्देशात्मक डिजाइनरों के लिए उपयोगी होते हैं जो नौसिखिया या सामयिक प्रोग्रामर होते हैं।

Characteristics of Flow chart – फ्लो चार्ट की विशेषतायें

As we know Flow chart is the graphical representation of programs used to demonstrate the flow diagram of the programs where number of symbol is used to indicate and display a certain meaning. The characteristic of flow chart:

जैसा की हम जानते हैं की फ्लो चार्ट किसी प्रोग्राम को डिजाईन करने का एक ग्राफिकल रिप्रजेंटेशन होता है। इसकी मदद से हम किसी प्रोग्राम को सॉल्व करने का डायग्राम तैयार करते हैं जिसमे प्रयुक्त सिंबल के अपने अपने मायने होते हैं जो प्रोग्राम के हल स्वरुप को संपूर्णतः प्रदर्शित करते हैं। नीचे फ्लो चार्ट विशेषता को डिटेल में प्रस्तुत किया गया है –

• Flow chart is the graphical representation and notation used to demonstrate the program control and flow graphically that makes a user more comprehensive and easy to understand.

फ्लो चार्ट एक ग्राफिकल प्रतिनिधित्व और अंकन है जिसका उपयोग प्रोग्राम कंट्रोल को प्रदर्शित करने और ग्राफिक रूप से फ्लो करने के लिए किया जाता है जो यूजर को अधिक व्यापक और समझने में आसान बनाता है।

• Flow chart symbols do keep a certain definition of their own to be used in a flow chart following with arrow symbols.

फ्लो चार्ट सिम्बल अपने स्वयं के एक निश्चित परिभाषा को तीर प्रतीकों के साथ फ्लो चार्ट में उपयोग करने के लिए रखते हैं।

Chapter wise Model Paper Link