What advantage does a linked list have over an array?
A linked list is not of a fixed size
When struct is used instead of the keyword class means, what will happen in the program?
access is public by default
Given the following Banana class in C++. Create a new Banana object properly
Banana sample("yellow");
In C++ what the following command does: delete a;
Free memory allocated for the variable
A function that changes the values of an object's attributes in a Class is also known as a:
Setter
What is the output of the following program segment?
10
Using a binary search why will the number 9 never be found in the following list: 11, 8, 13, 9, 7, 3
The list is not in order
The maximum comparisons needed in Binary Search on array of size 16 is:
4
Which sorting algorithm uses a pivot point?
Quick sort
A function can have _____ inside the parenthesis
Arguments/Parameters
We are sorting the following list in ascending order: 5 4 2 9 3 1 8 What does the list look like after ONE pass of the selection sort algorithm?
1 4 2 9 3 5 8
Specify whether the statement below is valid or invalid.
Invalid
How many null pointers exists in a circular linked list?
0
Make the following function return the following number in the fibonacci sequence
fibo(n-1)+fibo(n-2)
What output is displayed after the following segment of code executes:
10 an infinite number of times. top() simply copies the top element of the stack. Use push() to remove an element from the stack.
The following lists represent 3 passes of a sorting algorithm. Which algorithm is being used to sort the list?
Bubble Sort
Which sorting algorithm splits a list of items into individual lists?
Merge
When is Binary Search preferred over Linear Search?
Sorted Array
What is the worst case complexity of a quick sort algorithm?
O(𝒏^𝟐 )
In linked list implementation of a queue, the important condition for a queue to be empty is?
FRONT is null
The object in the image resembles which data structure
Linked List
If the sequence of operations - push (1), push (2), pop, push (1), push (2), pop, pop, pop, push (2), pop are performed on a stack, the sequence of popped out values
2,2,1,1,2
If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?
ABCD
What is the first change that insertion sort would make to this sequence? “6 2 5 9”
2 6 5 9
A ________ is blue print that defines certain characteristics and behavior. It is simply a representation of different types of objects.
Class
Your experience on this site will be improved by allowing cookies.