Data Structures

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/11

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.

12 Terms

1
New cards

What are the basic methods of a ArrayList?

  • add

  • get

  • remove

  • contains

2
New cards

What are the basic methods of a LinkedList?

  • add

  • get

  • remove

  • insert

  • contains

  • printList

3
New cards

What are the basic methods of a HashMap?

  • get

  • put

4
New cards

What are the basic methods of a Stack?

  • push

  • pop

5
New cards

What are the basic methods of a Queue?

  • add

  • remove

6
New cards

What are the basic methods of a Binary Search Tree?

  • add

  • search

  • preOrder

  • inOrder

  • postOrder

  • DFS

  • BFS

7
New cards

What is the time complexity of Binary Search Tree?

  • Balanced —> O(log2n)

  • Unbalanced —> O(n)

8
New cards

What is the time complexity of Queue?

O(1) —> constant

9
New cards

What is the time complexity of Stacks?

O(1) —> constant

10
New cards

What is the time complexity of Arrays/ArrayList?

O(1) —> constant

11
New cards

What is the time complexity of LinkedList?

  • Head & last —> O(1) constant

  • In between —> O(n)

12
New cards

What is the time complexity of HashMap?

  • Worst case —> O(n)

  • Average case —> O(1)