






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An overview of arrays, their declaration, address calculation, and various operations such as traversal, insertion, deletion, and search algorithms. It covers both one-dimensional and two-dimensional arrays, as well as sparse matrices and their efficient handling.
Typology: Slides
1 / 11
This page cannot be seen from the preview
Don't miss anything!
ARRAYS
ARRAYS Operations:
Binary Search BINARY_SEARCH (A, LB, UB, VAL) Step 1. Set BEG = LB, END = UB, POS = -1. Step 2. Repeat While BEG <= END do MID = INT (BEG+END)/ If A[MID] = = VAL then PRINT “Element found at MID position” POS = MID Go to Step 4. Else If A[MID] > VAL then END = MID - 1 Else BEG = MID + 1 End If Done Step 3. If POS = = -1 then PRINT “VAL not found” End If Step 4. Exit
Operations:
TRANSPOSE (A, M, N, B) Step 1. Repeat For I = 0 to M- Step 2. Repeat For J = 0 to N- Step 3. Set B[J][I] = A[I][J] [End Loop] [End Loop] Step 4. End 2-Dimensional Arrays
SPARSE MATRIX