Beruflich Dokumente
Kultur Dokumente
RECORD: Collection of different type of data, also termed as Tuple in Mathematical terms.
FIELD: An Individual column/data type is termed as field.
EXAMPLES OF STRUCTS:
EXAMPLES: Data for weather report (Row Day, Column Hours), Cricket Score (Row Teams, Column Overs).
Jagged Array:
Consider an example where your first dimension is Month and second dimension is days as shown below. For such cases
your Array is not a rectangle, you have different columns for different row number. Such array is called as Jagged Array.
This type of array is created by building a logic in your program as show below:
DS 3: List (array of Python, can create custom in Java and other lang.) VS Array:
Main difference between both of them is direct access (also called as Random access) and sequential access. In array
direct access of any element is very easy and fast because of its structure. Instead of Index of a particular elements, each
node in the list stores the link to another node and the value. See the list structure:
Arrays are good for directly access of an element while list are good for frequently adding/removing a node.
Previous link of object 1 and next link of object 5 are pointed to a terminator in Doubly link.
-------------------------------------------------------------------------------------------------------------List in Java:
Part of Collection framework, List is not a class in Java it is an interface. Following Java classes can also be used, called
as ArrayList or LinkList. NOTE: Python lists are array; Python dont have any linked list support.
Push: To add a value; Pop: To show and delete a value; Peek: To view the value
Binary Search Tree either have left child node or right child node or both or none. It is already sorted tree.
Left value is always less then right value. Suppose 3000 needs to be added to the tree, then first comparison will be with
50, its greater then it will right of 50. Now comparing with 100 its greater, it will move to the right again. Now comparing
with 1000 its greater again and so on.
Binary search tree should be balance (i.e., equal number of levels on the right and on the left of root node.
First 49 is kept on the top, now 99 will always be added to left. Next value is 50, is 50 greater than 49 yes, so it will be
placed to right. Next value is 150. Which will be added to left. Is 150 greater than 99 yes. Is not than 99 will be swapped
with 150. After that 150 will be compared to its parent again which is 49 and so on.
--------------------------------------------------------------------------------------------------------------