Munda Computer Edu Care

Traversing One Dimensional Array


ट्रैवर्सिंग डेटा संरचनाओं पर एक ऑपरेशन है। यह वह प्रक्रिया है जहां आप डेटा संरचना में मौजूद प्रत्येक और हर तत्व को सरणी या लिंक की गई सूची या उस डेटा के लिए किसी भी डेटा संरचना तक पहुंचते हैं।

एक्सेस करने का अर्थ है कि कम से कम हर तत्व का दौरा करना, बस उन्हें उपयोगकर्ता को दिखाना या सभी तत्वों पर एक ऑपरेशन करना।
उदाहरण के लिए, जब आपके पास प्रत्येक तत्व का प्रतिशत होता है, तो आप आवश्यक संचालन करते हुए, प्रत्येक और प्रत्येक तत्व से गुजरते हैं।

ट्रैवर्सल ऑपरेशन का सबसे मूल है जो किसी भी डेटा संरचनाओं पर किया जा सकता है।


Traversing is an operation on the data structures. It is the process where you access each and every element present in a data structure like an array or a linked list or any data structure for that matter.

Accessing means visiting every element at least ones, just to display them to the user or perform an operation on all the elements. For example, when you have the percentage of every element, you go through each and every element, performing the necessary operations.

Traversal is the most basic of the operations that can be performed on any data structures.

Traversing Algorithm in Linear Array

Traversing in Linear Array

 Array is a container which can hold a fix number of items and these items should be of the same type. Most of the data structures make use of arrays to implement their algorithms.
Traverse − print all the array elements one by one.or process the each element one by one .
Let A be a collection of data elements stored in the memory of the computer. Suppose we want to print the content of each element of A or suppose we want to count the number of elements of A with given property. This can be accomplished by traversing A, that is, by accessing and processing (frequently called visiting) each element of An exactly once.

Algorithm 

Step 1 :    [Initialization]  Set I = LB

Step 2 :      Repeat Step 3 and Step 4 while I  < = UB

step 3 :       [ processing ] Process the A[I] element

Step 4 :      [ Increment the counter ] I = I + 1
                   [ End of the loop of step 2 ] 

Step 5:       Exit 

(Here LB is  lower Bound and UB is Upper Bound  A[ ] is linear array )

Leave a Comment

Your email address will not be published. Required fields are marked *