Abstract Data Types

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/5

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

6 Terms

1
New cards

Abstract Data Type

Definition: behavior defined by a set of value and a set of operations

• Three ADTs: LIST ADT, STACK ADT, QUEUE ADT

Primary Concept of ADT:

• Spaghetti Code

• Modular Code

• Structured Programming

• Object Oriented Programming

2
New cards

LIST ADT

elements of same type arranged in sequential order

Operations:

• get() – Return element at any position

• insert() – Insert element at any position

• remove() – Remove first occurrence

• removeAt() – Remove at specified location

• replace() – Replace element at any position

• size() – Number of elements

• isEmpty() – True if list is empty

• isFull() – True if list is full

3
New cards

STACK ADT

All operations at one end — top of the stack

Operations:

• push() – Insert at top

• pop() – Remove and return top element

• peek() – Return top element without removing

• size() – Number of elements

• isEmpty() – True if stack is empty

• isFull() – True if stack is full

4
New cards

Stack Operations

• Push – Insert into stack

• Pop – Delete from stack

• Top – Insertion and deletion point

5
New cards

QUEUE ADT

insertion at end, deletion at front

Operations:

• enqueue() – Insert at end

• dequeue() – Remove and return first element

• peek() – Return front element without removing

• size() – Number of elements

• isEmpty() – True if queue is empty

• isFull() – True if queue is full

6
New cards

Queue Operations

  • AddQ/InsertQInsertion

  • RemoveQ/DeleteQDeletion

  • FrontDeletion point

  • RearInsertion point