Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 5261

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 61k
Author
Asked: November 27, 20242024-11-27T07:35:08+00:00 2024-11-27T07:35:08+00:00

How we can use pseudocode to solve problems efficiently whether you are a programmer or not.

  • 61k

Intro to the world of pseudocode:

It is common in computer science to use a technique called pseudocode that explains in plain English the steps contained in an algorithm or another system. Unlike normal programming languages, pseudocode is designed to be read by humans as opposed to by machines. It is an informal, artificial language that can be used by programmers to create algorithms. Most of the rules of pseudocode are straightforward and convenient to solve problems systematically and efficiently for any field that has problems to solve.

How can we use Pseudocode?

Pseudocode is used to formalize steps taken to solve a problem, in this case, an algorithm.

Let's imagine that we want to find a long-lost friend of ours in the phonebook, and the only thing we know is that their name starts with a J.

One solution would be to flip every page in the book from start until we arrive on the J page, but that would take too long and not be efficient at all.

Another solution would be to flip in the middle of the book, then access if j is on the left side of the book or right side and then flip towards the appropriate side in the middle again, and do this until we find the J page this would be a more efficient way to find the J page in the phone book.

Let's formalize the pseudocode for the second algorithm.

1 Pick up the phone book 2 Open to the middle of the phone book 3 Look at the page 4 If the page is J page 5      Call long lost friend 6 Else if J page is earlier in the book 7      Open to the middle of the left half of the book 9      Go back to line 3 10 Else if J page is later in the book 11      Open to the middle of the right half of the book 12      Go back to line 3 13 Else(if J page doesn't exist) 14      Quit 
Enter fullscreen mode Exit fullscreen mode

Now, the last part of quitting is important when writing a computer program because it gives clarity to the computer and eliminates chances for bugs and crashes by eliminating undefined behavior.

Why should we use pseudocode at all?

-Improved readability.
-It will also make code construction easier.
-Ideal as a middle ground between flowcharts and code.
-Serve as a starting point for documentation.
-Makes finding and fixing bugs easier.

Rules of writing pseudocode

As pseudocode is read by humans and not by a computer, everyone has a unique way of presenting things out, as its rules are less rigid than those of a programming language. However, some simple rules help make pseudocode more universal.

-Make sure to capitalize the first word.
-Limit the number of statements per line to one.
-Show hierarchy, improve readability and show nested
constructs with indents.
-Programming language independence is key.
-Names should reflect the problems.
-Be clear, concise, and readable.

Final thoughts

Pseudocode is widely used in programming and software/web development but it is a great tool for anyone that needs a good and systematic way to solve problems as long as the steps taken to a solution can be identified.

It brings clarity and minimizes risks for bugs and is a great start for your documentation. The more comfortable we become making pseudocode the easier it is to see the silver linings in problems at hand.

I hope you got some clarity out of this, if you have anything to add, then leave a comment below. Thanks

computerscienceprogrammingtutorialwebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 1k
  • Popular
  • Answers
  • Author

    How to ensure that all the routes on my Symfony ...

    • 0 Answers
  • Author

    Insights into Forms in Flask

    • 0 Answers
  • Author

    Kick Start Your Next Project With Holo Theme

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.