Follow

Translate

Wednesday, March 9, 2016

Traversing Linear Arrays

Algorithm 4.1: (Traversing a Linear Array) Here LA is a linear array with lower bound LB and upper bound UB. This algorithm traverses LA applying an operation Process to each element of LA.


1. [Initialize counter.] Set K : = LB.
2. Repeat Steps 3 and 4 while K < UB.
3. [Visit Element] Apply Process to LA[K].
4.  [Increase counter] Set K : = K +1.    // K = LB + 1
  [End of Step 2 Loop]
5. Exit.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Related Posts:

  • DELLSTH(INFO, LINK START, AVAIL) Algorithm: DELLSTH(INFO, LINK START, AVAIL) This algorithm delets the last node from the header list 1.         [List empty?] If LINK[START] = NULL, then: Write: UNDERFLOW,a nd Exi… Read More
  • POP(STACK, TOP, ITEM):   This procedure deletes the top element of STACK and assigns it to the variable ITEM 1.   [Stack has an ITEM to be remove?]       If TOP = 0, then: Print:… Read More
  • Representation Of Linked Lists In Memory Representation Of  Linked Lists In Memory:   Let LIST be a linked list. Then LIST will be maintained in memory, unless otherwise specified or implied, as follows. First of all,  LIST requires two linear a… Read More
  • What is Linked Lists?  Linked Lists:  A linked list, or one-way list, is a linear collection of data elements, called  nodes, where the linear order is given by means of pointers.The node is divided in the two parts; The first par… Read More
  • QINSERT(QUEUE, N, FRONT, REAR, ITEM) QINSERT(QUEUE, N, FRONT, REAR, ITEM) This procedure inserts an elements ITEM into a queue. 1.    [Queue already filled?]           If FRONT = 1 and REAR = N, or … Read More

0 comments:

Post a Comment