Java Collections and Data Structures

¡Supera tus tareas y exámenes ahora con Quizwiz!

What is a queue?

A FIFO data structure

What is a stack?

A LIFO data structure

What is a tree?

A Tree is a non-linear data structure where data objects are organized in terms of hierarchical relationship.

What are wrapper classes?

A class whose object wraps or contains a primitive data type.

What is the difference between a graph and a tree?

A graph is a collection of nodes and edges where a cycle can be formed. A tree is a collection of nodes and edges with a root node. There cannot be a cycle.

What is a graph?

A graph is a pictorial representation of a set of objects where some pairs of objects are connected by links. The interconnected objects are represented by points termed as vertices, and the links that connect the vertices are called edges.

What do data structures provide?

A means to manage large amounts of data efficiently.

What is recursion?

A method that calls itself until a solution has been reached.

What is a 2D array?

An array that contains arrays - a basic matrix

What is autoboxing?

Automatic conversion of primitive types to the object of their corresponding wrapper classes

What is the simplest sorting algorithm?

Bubble sort

What is Big O Notation?

Defines how long a function will take in relation to its input.

What is the Deque Interface?

Deque interface extends the Queue interface. In Deque, we can remove and add the elements from both sides. Deque stands for a double-ended queue which enables us to perform the operations at both the ends.

What are data structures?

Different ways to organize and store data.

Everything that stems from the Collection Interface is what?

Generic

What is time complexity in Big O Notation?

How long the algorithm will take

What is space complexity in Big O Notation?

How much memory an algorithm needs.

What is the purpose of generics?

It gives compile time safety for working with specific types in a very generalized solution.

This interface provides the facility of iterating the elements in a forward direction only.

Iterator

What is the difference between Iterator and Iterable?

Iterator interface provides the facility of iterating the elements in a forward direction only. The Iterable interface is the root interface for all the collection classes.

What is a LinkedList?

LinkedList implements the Collection interface. It uses a doubly linked list internally to store the elements. It can store the duplicate elements. It maintains the insertion order and is not synchronized. In LinkedList, the manipulation is fast because no shifting is required.

Is a bubble sort an optimal choice for sorting?

No, it is one of the slowest (least optimal) options for sorting.

What is the Queue Interface?

Queue interface maintains the first-in-first-out order. It can be defined as an ordered list that is used to hold the elements which are about to be processed.

What is bubble sort?

Sorts elements by comparing two at a time to determine the proper order. This process loops until all elements have been appropriately sorted.

What are examples of data structures?

Stack, Queue and LinkedList

What is the Collection Interface?

The Collection interface is the interface which is implemented by all the classes in the collection framework. It declares the methods that every collection will have.

What are algorithms?

The searching and sorting of data structures. An algorithm describes a way of solving a specific problem.

What is the stack collection?

The stack is the subclass of Vector. It implements the last-in-first-out data structure, i.e., Stack.

What are bitwise operators?

The | and the & operators

What are short circuit operators?

The || and && operators.

What do wrapper classes do?

They convert primitive data types into objects.

When are generics used?

When a method needs to work with various types at different times.

What do generics allow us to do?

Write a single generic method that can be called with arguments of different types.

Do generics enforce type safety?

Yes, they enforce type safety.

A bitwise operation operates on ...

one or more it patterns or binary numerals at the level of their individual bits.

Short-circuit operators are logical operators that ...

when evaluating two (or more) conditions, may or may not evaluate the entire statement based upon the resulting evaluation from a previous condition.


Conjuntos de estudio relacionados

NWM Guaranteed Exam Health and Life

View Set

Gerontology individual and family well being "adult"

View Set

Postwar America Topic 8 Assessment

View Set

Lesson 1 Multiplication & Division Flashcards 1-10

View Set

Introduction to Computer Hardware and Software

View Set

NSG 242 Chapter 31: Health Supervision

View Set