Skip to Main Content
Introduction to Computational Modeling Using C and Open-Source Tools
book

Introduction to Computational Modeling Using C and Open-Source Tools

by Jose M. Garrido
November 2013
Intermediate to advanced content levelIntermediate to advanced
461 pages
12h 1m
English
CRC Press
Content preview from Introduction to Computational Modeling Using C and Open-Source Tools
114 Introduction to Computational Modeling
(a) Compare the current element with the requested value or key. If the value
of the array element satisfies the condition, store the value of the index
of the element found and terminate the search.
(b) If values are not equal, continue search.
2. If no element with value equal to the value requested is found, set the result to
value 1.
The following algorithm in pseudo-code searches the array for an element with
the requested value, kval. The algorithm outputs the index value of the element equal
to the requested (or key) value kval. If no element with value equal to the requested
value is found, the algorithm outputs a negative value.
description
This algorithm defines a linear search of array varr using
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

Computer Fundamentals and Programming in C (RMK)

Computer Fundamentals and Programming in C (RMK)

Anita Goel, Ajay Mittal

Publisher Resources

ISBN: 9781482216783