Skip to content

Commit 5d8d644

Browse files
committed
What are data structures?
1 parent bb71240 commit 5d8d644

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed

Data Structures.ipynb

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Data Structures"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"Data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.\n",
15+
"\n",
16+
"General data structures include Arrays, files, linked lists, stacks, queues, trees, graphs and so on.\n",
17+
"\n",
18+
"Data structures, depending upon their organization are mainly classified into two types:\n",
19+
"\n",
20+
"#### Linear Data Structures:\n",
21+
"\n",
22+
"Elements are accessed in 'Linear'/ Sequential order but it is not compubory to store all elements sequentially.\n",
23+
"Examples: Linked Lists, Stacks alld Queues.\n",
24+
"\n",
25+
"#### Non-linear Data Structures:\n",
26+
"\n",
27+
"Elements of this data structure arc stored /accessed in a non-linear order.\n",
28+
"Examples: Trees and graphs."
29+
]
30+
},
31+
{
32+
"cell_type": "markdown",
33+
"metadata": {
34+
"collapsed": true
35+
},
36+
"source": [
37+
"## Abstract Data Type (ADT)"
38+
]
39+
},
40+
{
41+
"cell_type": "markdown",
42+
"metadata": {},
43+
"source": [
44+
"Abstract Data Type(ADT) is a data type, where only behavior is defined but not implementation.\n",
45+
"\n",
46+
"A data type can be considered abstract when it is defined in terms of operations on it, and its implementation is hidden (so that we can always replace one implementation with another for, e.g., efficiency reasons, and this will not interfere with anything in the program).\n",
47+
"\n",
48+
"An abstract data type or ADT (sometimes called an abstract data type) is a mathematical model of a data structure. It describes a container which holds a finite number of objects where the objects may be associated through a given binary relationship."
49+
]
50+
},
51+
{
52+
"cell_type": "markdown",
53+
"metadata": {},
54+
"source": [
55+
"Commonly used ADTs include: Linked Lists, Stacks, Queues, Priority Queues, Binary Trees, Dic tionaries,\n",
56+
"Disjoint Sets (Union a nd Find), Hash Tables, Grap hs, and many othe rs."
57+
]
58+
},
59+
{
60+
"cell_type": "markdown",
61+
"metadata": {},
62+
"source": [
63+
"## Recursion"
64+
]
65+
},
66+
{
67+
"cell_type": "markdown",
68+
"metadata": {},
69+
"source": [
70+
"Any function which calls ilself is called recursive. A recursive method solves a problem by calling a copy of itself to work on a smaller problem. This is called the recursion step. The recursion step can result in many more\n",
71+
"such recursive calls.\n",
72+
"\n",
73+
"It is important to ensure that the recursion terminates. Each time the function calls itself with a slightly simpler version of the original problem. The sequence of smaller problems must eventually converge on the base case."
74+
]
75+
},
76+
{
77+
"cell_type": "code",
78+
"execution_count": null,
79+
"metadata": {
80+
"collapsed": true
81+
},
82+
"outputs": [],
83+
"source": []
84+
}
85+
],
86+
"metadata": {
87+
"kernelspec": {
88+
"display_name": "Python 3",
89+
"language": "python",
90+
"name": "python3"
91+
},
92+
"language_info": {
93+
"codemirror_mode": {
94+
"name": "ipython",
95+
"version": 3
96+
},
97+
"file_extension": ".py",
98+
"mimetype": "text/x-python",
99+
"name": "python",
100+
"nbconvert_exporter": "python",
101+
"pygments_lexer": "ipython3",
102+
"version": "3.5.2"
103+
}
104+
},
105+
"nbformat": 4,
106+
"nbformat_minor": 2
107+
}

0 commit comments

Comments
 (0)