You are not logged in. Lock_open    

Video: 'Linear Search of an Array (Eclipse)'

Linear Search of an Array (Eclipse) Time: 9:08
Average:
  • Currently 3.1/5 Stars from 50 ratings
  •  
  •  
  •  
  •  
  •  
50 ratings
Your Rating:
  • Currently 0.0/5 Stars from 50 ratings
  • 1
  • 2
  • 3
  • 4
  • 5
Categories: Conditional Array Loop Logic Error Debugging Process Eclipse
Narration language: Gb English

Tags Tag_orange:
q

Flash_icon Watch Online 47.68Mb
Quicktime_small Download 8.68Mb (Right-click and select 'save as')

Description:

This video shows a program which is searching through an array, in a linear fashion, looking for a value. It has an if…else statement within a loop which assigns a boolean value to a variable called “found” every iteration of the loop (if theArray[index] == value). It shows that the code works for any value not in the array, but that it always reports “found” to be false, even for values that are in the array. By inserting print statements at the start of the if block and then in the else block, it shows that “found” is updated every iteration of the loop, potentially overwriting the assignment of true to “found.”



Leave a comment about this video...

What others are saying