1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Develop the algorithm as a module

  1. Aug 11, 2006 #1
    Consider the following specification:
    pre n >= 1
    post search module(a, n, number) = FOUND(a, number)
    reads a, n, number
    changes -
    mem -

    Remark: Let i be an integer number. Then, FOUND = 0 iff a does not contain
    number and FOUND = i iff a = number. search module is the name of the module
    to be developed.
    Design a search algorithm that searches for an integer number and that suffices the
    above specification. Develop the algorithm as a module. Use the pseudo code notation

    smby pls help
  2. jcsd
  3. Aug 11, 2006 #2


    User Avatar
    Science Advisor

    What are your thoughts? Also, what is a "module"?
    Last edited: Aug 11, 2006
  4. Aug 12, 2006 #3
    try to search through the arrays [a] to see whether the number is found or not.If not,proceeds to the second position
  5. Aug 12, 2006 #4


    User Avatar

    Staff: Mentor

    So can you please show us your first attempt at coding this up?
  6. Aug 12, 2006 #5


    User Avatar

    Staff: Mentor

    Also, could you please post a brief reference to the pseudo-code style that you are using? I'm not getting it.
  7. Sep 4, 2006 #6
    I do not understand the pseudocode very well either but I can help...

    So you got an integer array. And you're looking for a certain number in the array. So this module is suppose to take care of that.

    How would you traditionally sort through a list of things if you were looking for a certain thing in the list? You would start at the top of the list and keep going down until you found the thing you were looking for. Has your teacher taught you anything about control structures yet? If so, then you should be able to figure it out from here.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Develop the algorithm as a module
  1. Qpsk modulation (Replies: 1)

  2. AM modulation (Replies: 1)

  3. Angle Modulation (Replies: 12)

  4. Memory module (Replies: 2)