Docsity

Data Structures and algorithms Tests, Exercises of Data Structures and Algorithms

Toggle sidebar
bg1
Data Structures and
algorithms
{82} - What is the set that results from set1 intersection set2, given these
sets?
set1 = {69,82,47}
set2 = {11,82}
* {82}
* {69,82,47,11}
* {69,82,47}
* {11,82}
+= - Which operator is a type of assignment operator?
* +
* +=
* ==
* ||
1,8,9,3,5 - What is the resulting stack when the push(1) function is
implemented on this stack yield?8,9,3,5(top is 8)
* 8,9,3,5,1
* 8,9,3,5
* 1,8,9,3,5
* 8,9,3,1
2 - How many leaf nodes does this tree have?
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Data Structures and algorithms Tests and more Exercises Data Structures and Algorithms in PDF only on Docsity!

Data Structures and

algorithms

{82} - What is the set that results from set1 intersection set2, given these sets? set1 = {69,82,47} set2 = {11,82}

  • {82}
  • {69,82,47,11}
  • {69,82,47}
  • {11,82} += - Which operator is a type of assignment operator?
  • +=
  • ==
  • || 1,8,9,3,5 - What is the resulting stack when the push(1) function is implemented on this stack yield?8,9,3,5(top is 8)
  • 8,9,3,5,
  • 8,9,3,
  • 1,8,9,3,
  • 8,9,3, 2 - How many leaf nodes does this tree have?

Anne / Peter Zara | Savannah 2/N< 37 11 - How many elements will be compared to linear search for 27 in this list? [9,3,7,2,8,15,13,35,95,7,4]

  • 0
  • 10
  • 11
  • 121 111 - What is the pivot point given the quicksort on this list? Consider the lowindex = 5 and highindex = 9.(43,3,72,18,2,28,51,111,66,71) A doubly linked list - What would be the best data structure for a hash table with simple chaining?
  • A binary tree
  • A doubly linked list
  • A singly linked list
  • An array A posteriori analysis - Which review of an algorithm happens after implementation?
  • Binary search
  • A posteriori analysis
  • A priori analysis
  • Linear search Anne - What is the root node for this tree? Anne / \

Peter Zara | Savannah Array - Which format is used to store data in a hash table?

  • Graph
  • Array
  • ArrayList
  • Doubly linked lists Array - Which term describes an abstract data type (ADT) that Python uses?
  • Array
  • Numeric
  • String
  • Char Binary - Which algorithm requires data sorting as its first step?
  • Recursive
  • Linear
  • Binary
  • Merge Binary Search - What is the primary method used to search for an item in a sorted array? A. Binary search B. Jump Search C. Exponential search
  • Uses for loops
  • Uses case statements Class - What term refers to a template for creating an object? A. Application B. Class C. Method D. Algorithm clear() - Which Python list function will remove all items from a list?
  • clear()
  • remove()
  • pop()
  • extend() Collections - Which tool in Python is used to implement a deque ADT?
  • Abstraction
  • String
  • Collections
  • Robust count() - Which function in Python returns the number of times the desired value is found in a tuple?
  • index()
  • len()
  • count()
  • pop()

Data Structure - Which term describes a way of organizing, storing, and performing operations on data?

  • Data structure
  • Vertex
  • Record
  • Graph Default - Which component of a case statement would be considered a fall back in case no other parameters are met?
  • Else
  • Default
  • Break
  • Continue dequeue - Which queue operation removes an item from the front of the queue?
  • dequeue
  • enqueue
  • push
  • peek Do While - Which loop type will always be done at least once?
  • For
  • Do while
  • While
  • Foreach
  • Heap
  • Hash table
  • List
  • Queue Hash Table - Which data structure is used to store unordered items by mapping each item to a location in an array?
  • Stack
  • List
  • Dictionary
  • Hash table index() - Which function in Python is used to find a specific value in a tuple?
  • index()
  • len()
  • print()
  • dict() Indexes - Which element refers to the numeric positions in a list abstract data type (ADT)?
  • Head
  • Queue
  • Priority
  • Indexes int myVar - How would a strongly typed language create an integer variable?
  • Var myVar
  • int myVar
  • String myVar
  • let big: number = 0 Interval Search - Which search algorithm has the best performance when the data set is sorted?
  • Sequential search
  • List search
  • Interval search
  • Linear search isEmpty() - Which function determines that a linked list contains no data?
  • IsEmpty()
  • peek()
  • insert()
  • put() It consists of variables and methods - Which characteristic of a class allows it to be used as an abstract data type (ADT)?
  • Overloading
  • Instantiation
  • It consists of variables and methods
  • Overriding Linear - Which term refers to a type of search algorithm? A. Linear B. Divide-and-conquer
  • Subscript O(N) - What is the runtime complexity for the expression 305 + O(325*N)?
  • O(N^2)
  • N^
  • O(N^N)
  • O(N) O(N*log(N)) - What is the average runtime complexity of the merge sort algorithm?
  • O(N)
  • O(N^)
  • O(log(N))
  • O(N*log(N)) O(N^3) - What is the runtime complexity for this code? for x in range(N):f or y in range(N): for z in range(N): tot = tot + z print tot
  • O(3)
  • O(N^2)
  • O(N)
  • O(N^3)

pop() - Which function in Python is used to delete one item on the right side of the deque?

  • extend()
  • pop()
  • insert()
  • index() Record - What is referred to as a data structure that stores subitems? A. Array B. Matrix C. Record D. Graph Record - Which term refers to a data structure that groups related items of data together?
  • Pointer
  • Graph
  • Record
  • Hash table Recursive - Which function is used in conjunction with a merge sort algorithm?
  • For loop
  • If statement
  • Do while loop
  • Recursive
  • Tree-based data structure
  • Array
  • String
  • Number Two - What is the height for this tree? Anne / Peter Zara | Savannah Uses an agnostic code repository - Which characteristic of an algorithm is independent in nature? A. Uses Python to implement the algorithm B. uses MySQL for the database needs of the algorithm's application C. Uses Windows to install the application D. Uses an agnostic code repository Worst case - What does a time complexity analysis of an algorithm include?
  • Memory usage
  • Efficiency analysis
  • Screen load times
  • Worst case x = 25 - What is x in the following block of logic? x=

else

  • If x >= 10 and x <
    • x =
  • elif x <=
    • x =
  • elif x >=
    • x =
    • x =