Intro Flashcards

1
Q

What is a Data Structure?

A

A data structure is a storage that is used to store and organize data. It is a way of arranging data on a computer so that it can be accessed and updated efficiently.

A data structure is not only used for organizing the data. It is also used for processing, retrieving, and storing data. There are different basic and advanced types of data structures that are used in almost every program or software system that has been developed. So we must have good knowledge about data structures.

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

What is the classification of Data Structures?

A

1. Linear Data Structure: Data structure in which data elements are arranged sequentially or linearly, where each element is attached to its previous and next adjacent elements, is called a linear data structure.
Example: Array, Stack, Queue, Linked List, etc.
2. Static Data Structure: Static data structure has a fixed memory size. It is easier to access the elements in a static data structure.
Example: array.
3. Dynamic Data Structure: In dynamic data structure, the size is not fixed. It can be randomly updated during the runtime which may be considered efficient concerning the memory (space) complexity of the code.
Example: Queue, Stack, etc.
4. Non-Linear Data Structure: Data structures where data elements are not placed sequentially or linearly are called non-linear data structures. In a non-linear data structure, we can’t traverse all the elements in a single run only.
Examples: Trees and Graphs.

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

What is an Array?

A

Array is a linear data structure that stores a collection of elements of the same data type.

Elements are allocated contiguous memory, allowing for constant-time access.

Each element has a unique index number.

https://www.geeksforgeeks.org/array-data-structure-guide/

https://www.geeksforgeeks.org/explore?page=1&category=Arrays&sortBy=submissions

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

What is Matrix/Grid?

https://www.geeksforgeeks.org/matrix/

A

Matrix is a two-dimensional array of elements, arranged in rows and columns.

It is represented as a rectangular grid, with each element at the intersection of a row and column.

https://www.geeksforgeeks.org/explore?page=1&category=Matrix&sortBy=submissions

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

What are Strings?

https://www.geeksforgeeks.org/string-data-structure/

A

String is a sequence of characters, typically used to represent text.

It is considered a data type that allows for the manipulation and processing of textual data in computer programs.

https://www.geeksforgeeks.org/explore?page=1&category=Strings&sortBy=submissions

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

What is a Stack?

http://geeksforgeeks.org/stack-data-structure/

A

Stack is a linear data structure that follows the Last In, First Out (LIFO) principle.

Stacks play an important role in managing function calls, memory, and are widely used in algorithms, web development, and systems like compilers and browsers.

https://www.geeksforgeeks.org/explore?page=1&category[]=Stack

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

What is a Queue?

https://www.geeksforgeeks.org/queue-data-structure/

A

Queue is a linear data structure that follows the First In, First Out (FIFO) principle.

Queues play an important role in managing tasks or data in order, scheduling and message handling systems.

https://www.geeksforgeeks.org/explore?page=1&category=Queue&sortBy=submissions

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

What is a Linked List?

https://www.geeksforgeeks.org/linked-list-data-structure/

A

Linked list is a linear data structure that stores data in nodes, which are connected by pointers.

Unlike arrays, nodes of linked lists are not stored in contiguous memory locations and can only be accessed sequentially, starting from the head of list.

https://www.geeksforgeeks.org/explore?page=1&category[]=Linked%20List

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

What is Hashing?

https://www.geeksforgeeks.org/hashing-data-structure/

A

Hashing is a technique that generates a fixed-size output (hash value) from an input of variable size using mathematical formulas called hash functions.

Hashing is commonly used in data structures for efficient searching, insertion and deletion and plays a key role in software applications like secure data retrieval, password storage, cryptography, digital signatures, etc.

https://www.geeksforgeeks.org/explore?page=1&category=Hash&sortBy=submissions

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

What is a Tree?

https://www.geeksforgeeks.org/tree-data-structure/

A

Tree is a non-linear, hierarchical data structure consisting of nodes connected by edges, with a top node called the root and nodes having child nodes. It is widely used in file systems, databases, decision-making algorithms, etc.

https://www.geeksforgeeks.org/top-50-tree-coding-problems-for-interviews/

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

What is a Binary Tree

https://www.geeksforgeeks.org/binary-tree-data-structure/

A

Binary Tree is a non-linear and hierarchical data structure where each node has at most two children referred to as the left child and the right child.

https://www.geeksforgeeks.org/explore?page=1&category=Tree&sortBy=submissions

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

What is a Binary Search Tree

https://www.geeksforgeeks.org/binary-search-tree-data-structure/

A

Binary Search Tree is a type of binary tree in which each node’s left subtree contains only values smaller than the node, and each node’s right subtree contains only values greater than the node.

This property applies recursively, meaning that for every node, its left and right subtrees must also satisfy the conditions of a valid Binary Search Tree.

https://www.geeksforgeeks.org/explore?page=1&category=Binary%20Search%20Tree&sortBy=submissions

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

What is a Heap?

https://www.geeksforgeeks.org/heap-data-structure/

A

Heap is a complete binary tree data structure that satisfies the heap property. Heaps are usually used to implement priority queues, where the smallest or largest element is always at the root of the tree.

https://www.geeksforgeeks.org/explore?page=1&category=Heap&sortBy=submissions

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

What is a Graph?

https://www.geeksforgeeks.org/graph-and-its-representations/

A

Graph is a non-linear data structure consisting of a finite set of vertices(or nodes) and a set of edges(or links)that connect a pair of nodes.

Graphs are widely used to represent relationships between entities.

https://www.geeksforgeeks.org/explore?page=1&category[]=Graph

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

What are advanced Data Structures?

https://www.geeksforgeeks.org/advanced-data-structures/

A

Advanced Data Structures are complex arrangement of data which are used to organize, store, and manipulate data efficiently, enabling faster and more effective processing in complex algorithms.

Unlike basic data types such as arrays and linked lists, these structures include more sophisticated options like Segment Trees, Trie, Binary Indexed Tree, Suffix Array etc.

https://www.geeksforgeeks.org/explore?page=1&category=Advanced%20Data%20Structure&sortBy=submissions

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