A list is ordered from left to proper through the location of its objects. The offset of an object from the start of the list is known as its index. therefore, the first item has an index 0, the second item (if there is one) has an index 1, etc. A list of remember n has index domain from 0 to n–1.
Given a list L, the item at index i is accessed by using L[i]. Retrieving an object by its index is called item indexing. for example,
Items in a list can also be assigned via item indexing. Thus,
The most common operation on two lists is to sign up for them together to shape a larger list. extra precisely, the join operator (,) appends its right operand to the end of the left operand and returns the result. It accepts an atom in both argument.
Data complexity is built by the usage of lists as items of lists.
The variety of ranges of nesting for a list is called its depth. Atoms have a depth of 0 and simple lists have a depth of 1.
Here is a list of depth 3 having two items −
It is possible to index at once into the items of a nested list.
Repeated item Indexing
Retrieving an item through a single index always retrieves an uppermost item from a nested list.
Since the result L is itself a list, we can retrieve its elements using a single index.
We can repeat single indexing once more to retrieve an item from the innermost nested list.
You can read this as,
Get the object at index 1 from L, and from it retrieve the item at index 2, and from it retrieve the item at index 0.
Notation for Indexing at depth
There is an trade notation for repeated indexing into the parts of a nested list. The final retrieval also can be written as,
Assignment via index also works at depth.
Retrieve all items within the second position of every list on the top level.
Retrieve the items in the third role for each list at the second level.
KDB+ Related Interview Questions
|Perl Scripting Interview Questions||Python Interview Questions|
|Adv Java Interview Questions||Oracle Interview Questions|
|Database Interview Questions||Database Testing Interview Questions|
|Database Administration Interview Questions||DB2 SQL Programming Interview Questions|
|NoSQL Interview Questions||Unix/Linux Interview Questions|
|Database Mirroring Interview Questions|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.