The animated image below shows a traversal of a binary tree. Which type of traversal is it?
Search Results
Searching for: multiple choice
Individual Exercises
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 nodes are internal nodes? Not all internal nodes are represented in the options.
The image below shows a binary tree. Which nodes are leaf nodes?
A graph with relatively few edges is called:
A graph with many edges is called:
A graph that does not have a path of length 3 or more that connects a node v to itself is:
A directed graph is one
A complete graph is one which each pair of vertices:
A DAG is:
The sequence of vertices v1...vn with edges connecting all the vertices is called:
Trees and lists are special cases of graphs.
Based on the adjacency matrix shown below, which of the following statements is true:
The adjacency matrix shown below is an accurate representation of the graph shown below.
On a breadth first search traversal of the graph shown below, and starting at node a, the first three nodes visited are:
On a depth first search traversal of the graph shown below, and starting at node a, the first three nodes visited are:
At the heart of test-driven development is writing ___.
Consider a linear search as shown below.
int linearSearch(int w, int[] num) { // linear search code here }
Assume you call this method...
Binary search is a more efficient search than linear search. Which one of these is true?
What is wrong with this code?
String x; if (x.length() > 0) System.out.println("Hello "+x);
What does this code do?
int nums[] = {}; System.out.println(nums.length);
Given an integer num
, return the sum of the multiples of num
between 1 and 100. For example, if num
is 20, the returned value should be...
Given two integers size
and num
, return an array that can hold size
integers and is filled with multiples of num
, starting with num
. For...
Surround the appropriate lines of code with a try catch block so that first, an exception is caught when the String index is out of...