Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9324479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T04:36:35+00:00 2026-06-19T04:36:35+00:00

I’m taking a CS course but frankly I’ve no idea what the lecturer is

  • 0

I’m taking a CS course but frankly I’ve no idea what the lecturer is talking about in regards to abstract data type algebra. It’s not something I’ve readily been able to find a solution for on the web and I thought maybe someone out there in the community would have greater insight or undestanding into the problem.

Stack:

isempty(createstack()) = true
isempty(push(n, s)) = false 
top(push(n, s)) = n 
pop(push(n, s)) = s

Queue:

isempty(createqueue()) = true
isempty(add(n, q)) = false
front(add(n, q)) = n, if q is empty
front(add(n, q)) = front(q), if q is not empty removefront(add(n, q)) = q,
if q is empty      removefront(add(n, q)) = add(n, removefront(q)),
if q is not empty

the notation is certainly a bit odd… what does the above mean in real terms ~ i understand the general behaviour of a queue and a stack as first in first out vs first in last out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T04:36:37+00:00Added an answer on June 19, 2026 at 4:36 am

    Abstract Data Types can be used to describe how the behavior of types must be without specifying an implementation. You define a type as a set of axioms or rules that describe what conditions must hold in every moment. Djikstra once said that ADTs where a very useful tool to describe the behavior of queues… But well, leaving Djikstra’s known hyper-critic humor aside, I can think of at least one real application of ADT’s: assertions.

    Assertions allow you to specify how your type works in a formal, compilable, runnable language (as opposed to natural language documentation). In Design by contract methodoloy they are often written as predicates that must hold before or after the execution of a method (in general any operation on the type) in source language or some form of meta-language. Frameworks that support assertions (such as CodeContracts for .NET) do an automatic check that every predicate holds when it should. This way if you’re own code violates one of your assertions, you know you have a bug. So in some sense it can be seen as a form of unit testing, not by specifying test cases (which would be the empirical testing methodology), but by specifying preconditions, post-conditions and invariants that your type must fit (which would be the theoretical testing methodology).

    Although not used in mainstream software development, as far as I know, (checking assertions can be a performance hit) they can be used during testing.

    From the purely theoretical point of view ADTs are just that, an abstraction that allows us to reason about the behavior of types regardless of their specific implementation. If you like formalisms (like I do), nothing is better that having a developer give you a list of theorems rather than a ambiguous babble describing what his code is supposed to do.

    On the other hand, some alternative programming paradigms (alternative as in alternative to Object-Oriented, not as in secondary, unimportant, etc.) such as logic or functional programming are heavy based of ADTs for the types constructions. A very interesting example is the Haskell language. It gives you a hole new picture of types, inheritance and polymorphism.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This could be a duplicate question, but I have no idea what search terms
I want to construct a data frame in an Rcpp function, but when I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I need a function that will clean a strings' special characters. I do NOT
I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.