Difference between revisions of "More With Arrays Review Questions and Exercises"

From CompSciWiki
Jump to: navigation, search
(<div id="searching arrays e">Apply the Binary Search</div>)
m (Updated Next page.)
 
(57 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Template:1010Topic|Chapter_TOC=[[Selection Search Algorithm]]|Introduction=
+
{{Template:1010Topic
|Overview=}}
+
|Chapter_TOC=[[More With Arrays]] > [[More With Arrays Review Questions and Exercises|Review Questions and Exercises]]
 +
|Previous=[[Parallel Arrays]]
 +
|Next=[[Java In-depth]]
 +
|Body=
 +
 
 +
 
  
 
==Review Questions==
 
==Review Questions==
===Passing Arrays using Methods===
+
==[[Find Element x Using Linear Search|Find Element x Using Linear Search]]==
===Working with Paritally Filled Arrays===
+
==[[Find Max Using Linear Search|Find Max Using Linear Search]]==
===Arrays of Strings===
+
==[[Count Element x Using Linear Search|Count Element x Using Linear Search]]==
===<div id="searching arrays q">Searching Arrays</div>===
+
==[[Find Element x Using Binary Search|Find Element x Using Binary Search]]==
#Does the array have to be sorted to use a linear search?
+
 
#Does the array have to be sorted to use a binary search?
+
 
#Which algorithm is more efficient: linear search, or binary search?
+
 
#Referring to the "phone book" example, which search algorithm uses the "cut the phone book in half" method - linear or binary search?
+
==[[Passing Arrays|Passing Arrays]]==
 +
 
 +
 
 +
==[[FillArray Method|Arrays of Strings]]==
 +
 
 +
==[[String Binary Search|Searching Arrays]]==
 +
 
 +
 
 +
==[[Creating a grocery list|Parallel Arrays]]==
  
[[More With Arrays Solutions#searching arrays sol|Solutions]]
 
  
 
===Sorting Arrays===
 
===Sorting Arrays===
===Parallel Arrays===
+
Sorting is covered in depth in the next computer science course: Comp 1020.
  
 
==Exercises==
 
==Exercises==
===<div id="searching arrays e">Apply the Binary Search</div>===
 
Modify the [[Searching Arrays#binary search algorithm|binarySearch()]] algorithm to keep count of how many elements the algorithm checks to find the desired element.  Print out each checked element's value (in other words, the value compared with the search value.)
 
  
[[More With Arrays Solutions#searching arrays e sol|Solution]]
+
==[[Passing Arrays|Passing Arrays]]==
 +
 
 +
==[[Student Record List With Parallel Arrays|Parallel Arrays]]==
 +
 
 +
==[[Find Element x Using Binary Search|Apply the Binary Search]]==
 +
 
 +
==[[FillArray Method|Array of Strings]]==
 +
 
 +
}}

Latest revision as of 23:41, 7 December 2011

COMP 1010 Home > More With Arrays > Review Questions and Exercises


Review Questions

Find Element x Using Linear Search

Find Max Using Linear Search

Count Element x Using Linear Search

Find Element x Using Binary Search

Passing Arrays

Arrays of Strings

Searching Arrays

Parallel Arrays

Sorting Arrays

Sorting is covered in depth in the next computer science course: Comp 1020.

Exercises

Passing Arrays

Parallel Arrays

Apply the Binary Search

Array of Strings

Previous Page: Parallel Arrays Next Page: Java In-depth