CSC 301: Data Structures and Algorithms

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/22

flashcard set

Earn XP

Description and Tags

Flashcards covering introductory concepts of data structures, linear and non-linear types, abstract data types, graph terminology, tree definitions, and algorithm analysis from CSC 301.

23 Terms

1
New cards

What is the definition of a data structure?

A particular way of storing and organizing data in a computer so that it can be used efficiently, representing data, the operations allowed on that data, and the logical relationships between individual data elements.

2
New cards

What are the three core pairs of characteristics used to describe data structures?

  1. Linear or non-linear
  2. Homogeneous or heterogeneous
  3. Static or dynamic
3
New cards

How do static data structures differ from dynamic data structures?

Static data structures have fixed sizes, structures, and memory locations determined at compile time, whereas dynamic data structures have sizes, structures, and memory locations that can shrink or expand depending on use.

4
New cards
<p>Based on this taxonomy chart, what are the two broad subcategories of non-primitive data structures?</p>

Based on this taxonomy chart, what are the two broad subcategories of non-primitive data structures?

Linear Data Structures (e.g., Arrays, Linked Lists, Stacks, Queues) and Non-Linear Data Structures (e.g., Graphs, Trees, Hash Tables).

5
New cards

What four types are classified as primitive data structures?

Integer (Intege), Float, Character, and Boolean.

6
New cards

What are the six common operations performed on data structures?

  1. Traversal: Traveling through the data structure
  2. Search: Traversing for a given element
  3. Insertion: Adding new elements
  4. Deletion: Removing an element
  5. Sorting: Arranging elements in some order
  6. Merging: Combining two similar data structures into one
7
New cards

What is an Abstract Data Type (ADT)?

A programming concept that defines a high-level view (blueprint) of a data structure by specifying its behavior and interface without specifying implementation details.

8
New cards

What are the key properties of an array?

A sequence of nn items of the same data type stored contiguously in computer memory, featuring fixed length, contiguous memory locations, and direct access by specifying an index.

9
New cards

What are the defining characteristics of a linked list?

A sequence of nodes containing data and pointers (links) to other nodes, characterized by dynamic length, arbitrary memory locations, and sequential access by following links.

10
New cards
<p>Which linear data structure and operations are depicted in this diagram?</p>

Which linear data structure and operations are depicted in this diagram?

A Stack, illustrating the PUSH operation (adding an element to the top) and the POP operation (removing an element from the top) under LIFO (Last-In, First-Out) ordering.

11
New cards

How does a queue operate regarding element addition and removal?

A queue follows FIFO (First-In, First-Out) ordering; new elements are added via insertion/enqueue at the rear (back), and elements are removed via deletion/dequeue from the front.

12
New cards

How is a graph GG formally defined in graph theory?

G=(V,E)G = (V, E), where V(G)V(G) is a finite, nonempty set of vertices (nodes) and E(G)E(G) is a set of edges (pairs of vertices) that relate the nodes.

13
New cards

In graph theory, what is a simple path?

A path in which all vertices, except possibly the first and last, are distinct.

14
New cards

What defines a complete graph?

A graph in which every vertex is directly connected by an edge to every other vertex.

15
New cards

What is the definition of a cycle in a graph?

A simple path that has the same start and end vertex.

16
New cards

What does the degree of a vertex represent in an undirected graph?

The number of edges incident on that vertex.

17
New cards

What is a binary tree?

An ordered tree data structure in which each node has at most two children.

18
New cards
<p>What data structure and mapping process is illustrated in this diagram?</p>

What data structure and mapping process is illustrated in this diagram?

A Hash Table, showing a hash function mapping identifying keys (names) directly to specific numerical hashes (table indices).

19
New cards

What is an algorithm?

A sequence of unambiguous instructions for solving a problem, producing a required output for any legitimate input in a finite amount of time.

20
New cards

What are the five essential requirements of an algorithm?

  1. Finiteness (terminates after a finite number of steps)
  2. Definiteness (rigorously and unambiguously specified)
  3. Clearly specified input
  4. Clearly specified/expected output
  5. Effectiveness (steps are sufficiently simple and basic)
21
New cards

According to the lecture notes, what formula defines a computer program?

Program=algorithms+data structures\text{Program} = \text{algorithms} + \text{data structures}

22
New cards

What are the two primary ways to measure algorithm efficiency?

  1. Empirical comparison (running the program on a machine)
  2. Asymptotic algorithm analysis (analyzing performance theoretically without running the program)
23
New cards

In a sequential search for element kk within an array of nn integers, what are the best, worst, and average cases?

  • Best case: kk is the first element of the array.
  • Worst case: The search visits all nn elements (occurs when kk is the last element or not in the list).
  • Average case: The search visits n2\frac{n}{2} elements (assuming kk is present and equally likely to be at any index).