AbstractDataTypes Flashcards

1
Q

What is an abstract data type?

A

Defines the behavior of a data structure from point of a viewer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are generics?

A

Data structures sould work with any type, a class or interface can declare a type parameter, or a fake type, a placeholder.

Used in brackets MyClass<T></T>

returned as public t GetThing();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a stack interface?

A

Stores in reverse order.
LIFO – last in, first out.
Provides several operations – push, peek, pop, size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are queues and priority queues?

A

First in/first out. Priority queues assign priority, and the element w/ highest priority is removed first.

Has following methods:

enqueue - add an item to the end of the queue.
peek - return but do not remove the oldest item in the queue.
dequeue - remove and return the oldest item in the queue.
size - the number of elements currently in the queue.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a list?

A

A list is a popular data structure to store data in sequential order. For example, a list of students, a list of available rooms, a list of cities, and a list of books, etc. can be stored using lists. The common operations on a list are usually the following:
· Retrieve an element from this list.
· Insert a new element to this list.
· Delete an element from this list.
· Find how many elements are in this list.
· Find if an element is in this list.
· Find if this list is empty.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are two ways to implement a list?

A

Arrays, linkedlist of nodes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly