For this question, assume we have a stack created and stored in the variable s
. This stack supports the usual push()
, pop()
, and clear()
...
Search Results
Searching for: cci
Individual Exercises
The animated image below shows a traversal of a binary tree. Which type of traversal is it?
The animated image below shows a traversal of a binary tree. Which type of traversal is it?
The animated image below shows a traversal of a binary tree. Which type of traversal is it?
The image below shows an in progress inorder traversal. The nodes highlighted in purple have already been visited in order (e.g. 36 14 24...
The image below shows a binary tree. Which of the options below include only internal nodes?
The image below shows a binary tree. Which nodes are leaf nodes?
Complete the following binary search method on integers. Find the number search
in the array numbers
. Return the index of the element if...
Complete the following linear search method. Find the number search
in the array numbers
. If the number is found, return the index for...
Complete the following contains
method so it returns true
if the value being searched is found in the array, or false
otherwise. You must...
Complete the following linear search method. Find the number search
in the array numbers
. If the number is found, return the index for...
Complete the following linear search method. Find the string search
in the array words
. If the string is found, return the index for the...
Write a method replaceSpaceUnderscore
that replaces all spaces with _
(underscores) in the String sentence
.
Complete the method countTimesContains
that returns the number of times the array words
contains the word stored in searchW
. Remember to...
Write a method searchInLastN
that implements a linear search but only looks for values in the last positions, determined by the parameter...
Railroad diagrams, also known as syntax diagrams, are a visual way to represent the grammar of a programming language. To use it, you...
Railroad diagrams, also known as syntax diagrams, are a visual way to represent the grammar of a programming language. To use it, you...
Railroad diagrams, also known as syntax diagrams, are a visual way to represent the grammar of a programming language. To use it, you...
Railroad diagrams, also known as syntax diagrams, are a visual way to represent the grammar of a programming language. To use it, you...
How many times does the loop execute? That is, how many times is hello()
called?
for(;;) hello(); }
How many times does the loop execute? That is, how many times is hello()
called?
for (int i = 0; i < 5; i++) hello(); }
How many times does the loop execute? That is, how many times is hello()
called?
for (int i = 0; i <= 5; i++) hello(); }
How many times does the code below calls greetings()
?
for (int i = 0; i < 10; i++) hello(); greetings(); }
Given an array of int
s, return the POSITION (i.e., the index) of smallest value in the array. Assume the array has only posivitive...
Given an array of int
s, return the first value in the array. You may assume the array has at least one value.